Add backend log management

This commit is contained in:
inman
2026-06-03 11:49:45 +08:00
parent 13ddc66cfe
commit fb0229ba06
14 changed files with 804 additions and 2 deletions

View File

@@ -23,11 +23,16 @@ export function resultDir(): string {
return process.env.ZHINIAN_RESULT_DIR || join(runtimeDir(), "generated-results");
}
export function logDir(): string {
return process.env.ZHINIAN_LOG_DIR || join(runtimeDir(), "logs");
}
export async function ensureRuntimeDirs(): Promise<void> {
await Promise.all([
mkdir(dataDir(), { recursive: true }),
mkdir(uploadDir(), { recursive: true }),
mkdir(resultDir(), { recursive: true })
mkdir(resultDir(), { recursive: true }),
mkdir(logDir(), { recursive: true })
]);
}