Keep logs for a set number of days
Logs grew forever. A daily prune-logs cron now deletes entries older than the app setting logs_keep_days (Settings > General, super admin; default AppData.LogsKeepDays, 90), with an index on logs.created_at. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -4,6 +4,7 @@ import pruneBotsQueue from "./prune-bots-queue";
|
||||
import cronClearJobSteps from "./clear-job-steps";
|
||||
import pruneBotHookEvents from "./prune-bot-hook-events";
|
||||
import cronPruneChatrooms from "./prune-chatrooms";
|
||||
import pruneLogs from "./prune-logs";
|
||||
import syncNotifyWatchers from "./sync-notify-watchers";
|
||||
import cronSyncHarnessModels from "./sync-harness-models";
|
||||
import syncComputers from "./sync-computers";
|
||||
@@ -51,6 +52,12 @@ export default function cron() {
|
||||
task: cronPruneChatrooms,
|
||||
});
|
||||
|
||||
registerCronJob({
|
||||
title: "prune-logs",
|
||||
schedule: "@daily",
|
||||
task: pruneLogs,
|
||||
});
|
||||
|
||||
registerCronJob({
|
||||
title: "sync-notify-watchers",
|
||||
schedule: "*/5 * * * *",
|
||||
|
||||
Reference in New Issue
Block a user