agent starting :D

This commit is contained in:
2026-03-01 14:10:19 -06:00
parent c3379919b9
commit 68d13b03d3
34 changed files with 1905 additions and 254 deletions

View File

@@ -7,6 +7,7 @@ import { monitorReleaseChanges } from "./opendock/openDockRreleaseMonitor.utils.
import { opendockSocketMonitor } from "./opendock/opendockSocketMonitor.utils.js";
import { connectProdSql } from "./prodSql/prodSqlConnection.controller.js";
import { setupSocketIORoutes } from "./socket.io/serverSetup.js";
import { baseSettingValidationCheck } from "./system/settingsBase.controller.js";
import { createCronJob } from "./utils/croner.utils.js";
const port = Number(process.env.PORT) || 3000;
@@ -17,15 +18,20 @@ const start = async () => {
// triggering long lived processes
connectProdSql();
// start long live processes
// trigger startup processes these must run before anything else can run
await baseSettingValidationCheck();
//when starting up long lived features the name must match the setting name.
setTimeout(() => {
monitorReleaseChanges(); // this is od monitoring the db for all new releases
opendockSocketMonitor();
createCronJob("JobAuditLogCleanUp", "* 0 5 * * * *", () =>
// cleanup sql jobs
createCronJob("JobAuditLogCleanUp", "0 0 5 * * *", () =>
dbCleanup("jobs", 30),
);
createCronJob("logsCleanup", "* 15 5 * * * *", () => dbCleanup("logs", 30));
createCronJob("opendockAptCleanup", "* 30 5 * * * *", () =>
createCronJob("logsCleanup", "0 15 5 * * *", () => dbCleanup("logs", 120));
createCronJob("opendockAptCleanup", "0 30 5 * * *", () =>
dbCleanup("opendockApt", 90),
);
}, 5 * 1000);