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:
2026-10-28 04:49:25 +01:00
co-authored by Claude Opus 5.5
parent 5f96004f13
commit ba9705980e
14 changed files with 278 additions and 3 deletions
+14
View File
@@ -1117,6 +1117,15 @@ export type HookCallRetentionOverview = {
max: number;
};
/**
* How long logs are kept (Settings > General, `grab-logs-keep-days.ts`).
*/
export type LogRetentionOverview = {
keep_days: number;
default_days: number;
max: number;
};
/**
* The install's skill limits (Settings > General, `grab-skill-limits.ts`).
*/
@@ -1911,6 +1920,11 @@ export type PagePropsType = {
* General settings page).
*/
hook_call_retention?: HookCallRetentionOverview | null;
/**
* How many days logs are kept, with the code's default (the General
* settings page).
*/
log_retention?: LogRetentionOverview | null;
/**
* How long closed chatrooms are kept and how many one place keeps, with
* the code's defaults (the General settings page).