Skip to content

Commit 3395b84

Browse files
opencode-agent[bot]baicaizhale
authored andcommitted
Fix compilation error in CLIManager.java by adding getLogRetentionDays() method to ConfigManager
1 parent 04eb616 commit 3395b84

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main/java/org/YanPl/manager/CLIManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public void run() {
227227
return;
228228
}
229229

230-
int retentionDays = plugin.getConfigManager().getConfig().getInt("settings.log_retention_days", 15);
230+
int retentionDays = plugin.getConfigManager().getLogRetentionDays();
231231
long cutoffTime = System.currentTimeMillis() - (retentionDays * 24 * 60 * 60 * 1000L);
232232

233233
Files.list(logDir)

src/main/java/org/YanPl/manager/ConfigManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,14 @@ public boolean isDebug() {
386386
return config.getBoolean("settings.debug", false);
387387
}
388388

389+
/**
390+
* 获取日志保留天数
391+
* @return 日志保留天数
392+
*/
393+
public int getLogRetentionDays() {
394+
return config.getInt("settings.log_retention_days", 15);
395+
}
396+
389397
/**
390398
* 获取是否启用猫娘模式
391399
* @return 是否启用猫娘模式

0 commit comments

Comments
 (0)