fix(log): cyclic dependency to options breaking tests

This commit is contained in:
Elian Doran 2025-08-13 14:39:26 +03:00
parent 54efa6b38c
commit 7a036fc777
No known key found for this signature in database

View File

@ -6,7 +6,6 @@ import path from "path";
import { EOL } from "os";
import dataDir from "./data_dir.js";
import cls from "./cls.js";
import optionService from "./options.js";
if (!fs.existsSync(dataDir.LOG_DIR)) {
fs.mkdirSync(dataDir.LOG_DIR, 0o700);
@ -44,6 +43,7 @@ async function cleanupOldLogFiles() {
retentionDays = parsed;
}
} else {
const optionService = (await import("./options.js")).default;
retentionDays = optionService.getOptionInt("logRetentionDays", DEFAULT_RETENTION_DAYS);
}