mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
feat: added cron job to remove healthcheck logs older than 12h
This commit is contained in:
+10
-1
@@ -2,7 +2,7 @@ import cron from "node-cron";
|
||||
import {retentionCleanTask} from "@/lib/tasks/database";
|
||||
import {env} from "@/env.mjs";
|
||||
import {backupCleanTask} from "@/lib/tasks/cleaning";
|
||||
|
||||
import {deleteHealthLogsOlderThan12h} from "@/db/services/healthcheck";
|
||||
|
||||
export const retentionJob = cron.schedule(env.RETENTION_CRON, async () => {
|
||||
try {
|
||||
@@ -20,4 +20,13 @@ export const cleaningJob = cron.schedule("* * * * *", async () => {
|
||||
} catch (err) {
|
||||
console.error(`[CRON] Error:`, err);
|
||||
}
|
||||
});
|
||||
|
||||
export const cleaningHealthcheckLogsJob = cron.schedule(env.CLEANING_HEALTHCHECK_LOGS_CRON, async () => {
|
||||
try {
|
||||
console.log("Cleaning Healthcheck Logs Job : Starting task");
|
||||
await deleteHealthLogsOlderThan12h();
|
||||
} catch (err) {
|
||||
console.error(`[CRON] Error:`, err);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user