🔨 优化系统配置逻辑.

This commit is contained in:
lijiahangmax
2025-10-09 14:31:43 +08:00
parent 37fc271741
commit b0be444fba
17 changed files with 129 additions and 158 deletions

View File

@@ -50,12 +50,12 @@ public class AppLogConfig {
/**
* 是否生成详细的执行日志
*/
private final ConfigRef<Boolean> execDetailLog;
private final ConfigRef<Boolean> execDetailEnabled;
public AppLogConfig(ConfigStore configStore) {
this.trackerLoadLines = configStore.int32(ConfigKeys.LOG_TRACKER_LOAD_LINES);
this.trackerLoadInterval = configStore.int32(ConfigKeys.LOG_TRACKER_LOAD_INTERVAL);
this.execDetailLog = configStore.bool(ConfigKeys.LOG_EXEC_DETAIL_LOG);
this.execDetailEnabled = configStore.bool(ConfigKeys.LOG_EXEC_DETAIL_ENABLED);
}
public Integer getTrackerLoadLines() {
@@ -66,8 +66,8 @@ public class AppLogConfig {
return trackerLoadInterval.value;
}
public Boolean getExecDetailLog() {
return execDetailLog.value;
public Boolean getExecDetailEnabled() {
return execDetailEnabled.value;
}
}

View File

@@ -193,7 +193,7 @@ public class ExecTaskHandler implements IExecTaskHandler {
* @return handler
*/
private IExecCommandHandler createCommandHandler(Long execHostId) {
if (Booleans.isTrue(appLogConfig.getExecDetailLog())) {
if (Booleans.isTrue(appLogConfig.getExecDetailEnabled())) {
// 详细日志
return new ExecCommandDetailHandler(execHostId, execLog, builtParams, timeoutChecker);
} else {

View File

@@ -59,6 +59,7 @@ public interface UserCacheKeyDefine {
CacheKeyDefine LOGIN_FAILED_COUNT = new CacheKeyBuilder()
.key("user:login-failed:{}")
.desc("用户登录失败次数 ${username}")
.noPrefix()
.type(Integer.class)
.struct(RedisCacheStruct.STRING)
.build();

View File

@@ -49,6 +49,7 @@ public interface AlarmPolicyCacheKeyDefine {
CacheKeyDefine ALARM_RULE_SILENCE = new CacheKeyBuilder()
.key("alarm:silence:{}:{}")
.desc("告警规则沉默标志 ${agentKey} ${ruleId}")
.noPrefix()
.type(Long.class)
.struct(RedisCacheStruct.STRING)
.build();