db cleanups and logging for od

This commit is contained in:
2026-02-20 09:58:20 -06:00
parent 597d990a69
commit 2d1f613d39
17 changed files with 2452 additions and 53 deletions

View File

@@ -1,7 +1,7 @@
import { jobAuditLog } from "backend/db/schema/auditLog.schema.js";
import { Cron } from "croner";
import { eq } from "drizzle-orm";
import { db } from "../db/db.controller.js";
import { jobAuditLog } from "../db/schema/auditLog.schema.js";
import { createLogger } from "../logger/logger.controller.js";
// example createJob
@@ -19,6 +19,17 @@ export interface JobInfo {
// Store running cronjobs
export const runningCrons: Record<string, Cron> = {};
// how to se the times
// * ┌──────────────── (optional) second (0 - 59) \n
// * │ ┌────────────── minute (0 - 59)
// * │ │ ┌──────────── hour (0 - 23)
// * │ │ │ ┌────────── day of month (1 - 31)
// * │ │ │ │ ┌──────── month (1 - 12, JAN-DEC)
// * │ │ │ │ │ ┌────── day of week (0 - 6, SUN-Mon)
// * │ │ │ │ │ │ (0 to 6 are Sunday to Saturday; 7 is Sunday, the same as 0)
// * │ │ │ │ │ │ ┌──── (optional) year (1 - 9999)
// * │ │ │ │ │ │ │
// * * 05 * * * * *
/**
*
* @param name Name of the job we want to run