feat(notificaitons): fixed and corrections to get them working properly

This commit is contained in:
2025-04-04 17:12:48 -05:00
parent 99477bac19
commit a7818b4ca3
21 changed files with 888 additions and 633 deletions

View File

@@ -9,10 +9,12 @@ import { createLog } from "../logger/logger.js";
import { note, notificationCreate } from "./utils/masterNotifications.js";
import { startNotificationMonitor } from "./utils/processNotifications.js";
import notifyStats from "./routes/getActiveNotifications.js";
import tiTrigger from "./routes/manualTiggerTi.js";
import blocking from "./routes/qualityBlocking.js";
const app = new OpenAPIHono();
const routes = [sendemail, notifyStats] as const;
const routes = [sendemail, notifyStats, tiTrigger, blocking] as const;
const appRoutes = routes.forEach((route) => {
app.route("/notify", route);
@@ -41,21 +43,9 @@ if (notesError) {
);
}
if (note.length != notes?.length) {
setTimeout(() => {
notificationCreate();
createLog("info", "notify", "notify", `New notifcations being added.`);
setTimeout(() => {
startNotificationMonitor();
}, 5 * 1000);
} else {
createLog(
"info",
"notify",
"notify",
`There are know new notifcations. no need to run the update. reminder all changes happen per server.`
);
setTimeout(() => {
startNotificationMonitor();
}, 5 * 1000);
}
startNotificationMonitor();
}, 5 * 1000);
export default app;