fix: database health cron

This commit is contained in:
Charles GTE
2026-03-28 15:10:46 +01:00
parent 7aecd911c0
commit 0262a1c176
16 changed files with 5270 additions and 117 deletions
+6 -1
View File
@@ -2,7 +2,11 @@ import cron from "node-cron";
import {retentionCleanTask} from "@/lib/tasks/database";
import {env} from "@/env.mjs";
import {backupCleanTask} from "@/lib/tasks/cleaning";
import {checkAgentsHealthError, deleteHealthLogsOlderThan12h} from "@/db/services/healthcheck";
import {
checkAgentsHealthError,
checkDatabasesHealthError,
deleteHealthLogsOlderThan12h
} from "@/db/services/healthcheck";
export const retentionJob = cron.schedule(env.RETENTION_CRON, async () => {
try {
@@ -36,6 +40,7 @@ export const healthcheckAgentAndDatabaseJob = cron.schedule(env.HEALTHCHECK_CRON
try {
console.log("Healthcheck Job : Starting task");
await checkAgentsHealthError();
await checkDatabasesHealthError()
} catch (err) {
console.error(`[CRON] Error:`, err);
}