feat: implement scheduled cleanup job for expired data

This commit is contained in:
syntaxbullet
2026-01-06 17:44:08 +01:00
parent 606d83a7ae
commit bc89ddf7c0
4 changed files with 262 additions and 70 deletions

View File

@@ -69,6 +69,12 @@ export interface GameConfigType {
autoTimeoutThreshold?: number;
};
};
system: {
cleanup: {
intervalMs: number;
questArchiveDays: number;
};
};
}
// Initial default config state
@@ -160,6 +166,17 @@ const configSchema = z.object({
cases: {
dmOnWarn: true
}
}),
system: z.object({
cleanup: z.object({
intervalMs: z.number().default(24 * 60 * 60 * 1000), // Daily
questArchiveDays: z.number().default(30)
})
}).default({
cleanup: {
intervalMs: 24 * 60 * 60 * 1000,
questArchiveDays: 30
}
})
});