feat: auto-prune stale session artifacts on startup + daily
Session files (JSONLs, debug logs, todos, telemetry, group logs) accumulate unboundedly — especially from daily cron tasks. This adds a cleanup script that prunes old artifacts while protecting active sessions (read from DB), and wires it into the main process on a 24h interval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -61,6 +61,7 @@ import {
|
||||
loadSenderAllowlist,
|
||||
shouldDropMessage,
|
||||
} from './sender-allowlist.js';
|
||||
import { startSessionCleanup } from './session-cleanup.js';
|
||||
import { startSchedulerLoop } from './task-scheduler.js';
|
||||
import { Channel, NewMessage, RegisteredGroup } from './types.js';
|
||||
import { logger } from './logger.js';
|
||||
@@ -746,6 +747,7 @@ async function main(): Promise<void> {
|
||||
}
|
||||
},
|
||||
});
|
||||
startSessionCleanup();
|
||||
queue.setProcessMessagesFn(processGroupMessages);
|
||||
recoverPendingMessages();
|
||||
startMessageLoop().catch((err) => {
|
||||
|
||||
Reference in New Issue
Block a user