If scanLogsToKeep is <= 0 don't purge.

For now this would be a manual database update to configure this.
It does help future proof the setting being set in the UI.
This commit is contained in:
sir-wilhelm 2026-02-16 14:49:58 -06:00
parent f069475a4e
commit f819d661e8

View file

@ -41,6 +41,8 @@ class LogManager {
} }
async enforceDailyLogRetention() { async enforceDailyLogRetention() {
if (this.loggerDailyLogsToKeep <= 0) return
while (this.dailyLogFiles.length > this.loggerDailyLogsToKeep) { while (this.dailyLogFiles.length > this.loggerDailyLogsToKeep) {
await this.removeLogFile(this.dailyLogFiles[0]) await this.removeLogFile(this.dailyLogFiles[0])
} }
@ -197,6 +199,7 @@ class LogManager {
*/ */
async purgeOldScanLogs(logDir = this.ScanLogPath) { async purgeOldScanLogs(logDir = this.ScanLogPath) {
const scanLogsToKeep = this.loggerScannerLogsToKeep const scanLogsToKeep = this.loggerScannerLogsToKeep
if (scanLogsToKeep <= 0) return
let scanFiles let scanFiles
try { try {