refactor(ocp): change the way logs are brought in and other changes to clean the code up

This commit is contained in:
2025-04-09 17:49:03 -05:00
parent bad390ec17
commit 2e2699ab3c
20 changed files with 307 additions and 124 deletions

View File

@@ -3,6 +3,7 @@ import { ocmeData } from "../../../../database/schema/ocme.js";
import { differenceInMinutes } from "date-fns";
import { createLog } from "../../logger/logger.js";
import { eq } from "drizzle-orm";
import { timeZoneFix } from "../../../globalUtils/timeZoneFix.js";
export const getInfo = async () => {
let ocmeInfo: any = [];
@@ -16,7 +17,7 @@ export const getInfo = async () => {
ocmeInfo = ocmeInfo.map((o: any) => {
const now = new Date(Date.now());
//const strippedDate = o.add_Date.replace("Z", "");
const diff = differenceInMinutes(now, o.add_Date);
const diff = differenceInMinutes(timeZoneFix(), o.add_Date);
return { ...o, waitingFor: diff };
});
createLog(