fix 兼容 log.autoBackConsoleCron: none 配置属性

This commit is contained in:
bwcx_jzy 2022-07-26 12:54:17 +08:00
parent 8e1b054677
commit 88fa256a29
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
2 changed files with 12 additions and 1 deletions

View File

@ -14,6 +14,7 @@
2. 【server】触发器 token 机制调整,取消 SHA256 生成。采用数据表单独存储
3. 【server】修复启动加载全局代理时机,避免The database is not initialized
4. 管理脚本执行支持环境变量配置 jvm、端口等`JPOM_AGENT_JVM`,`JPOM_AGENT_PORT`,`JPOM_AGENT_ARGS`、`JPOM_SERVER_JVM`,`JPOM_SERVER_PORT`,`JPOM_SERVER_ARGS` 感谢@飞儿
5. 【agent】兼容 `log.autoBackConsoleCron: none` 配置属性
------
@ -54,6 +55,10 @@
4. 【server】修复编辑构建仓库切换事件重复问题 (感谢[@五六](https://gitee.com/tutu-father) [Gitee issues I5F35E](https://gitee.com/dromara/Jpom/issues/I5F35E)
5. 【server】修复 windows 执行脚本出现异常(感谢[@all-around-badass](https://gitee.com/all-around-badass) [Gitee issues I5FK0K](https://gitee.com/dromara/Jpom/issues/I5FK0K)
### ❌ 不兼容事项
1. 插件端 `log.autoBackConsoleCron` 配置属性替换为:`log.autoBackToFile`
------
## 2.9.2 (2022-06-27)

View File

@ -186,7 +186,13 @@ public class AgentExtConfigBean {
* @return 如果表达式配置为none 则不配置重启也不备份
*/
public boolean openLogBack() {
return Optional.ofNullable(autoBackToFile).orElse(true);
boolean newConfig = Optional.ofNullable(autoBackToFile).orElse(true);
if (newConfig) {
// 使用旧配置
String cron = StrUtil.emptyToDefault(autoBackConsoleCron, "none");
return !"none".equalsIgnoreCase(cron.trim());
}
return false;
// if(autoBackToFile==null || autoBackToFile){
// return
// }