This commit is contained in:
2026-02-24 17:53:43 -06:00
parent da6e0311d8
commit 06e021f8a1
21 changed files with 3144 additions and 77 deletions
+18 -1
View File
@@ -1,8 +1,10 @@
import { refresh } from "./api/auth";
import app from "./api/server";
import { engine, PORT } from "./constants";
import { engine, PORT, unifi, unifiPassword, unifiUsername } from "./constants";
import { unifiSites } from "./managers/unifiSites";
import { refreshCompanies } from "./modules/cw-utils/refreshCompanies";
import { refreshCatalog } from "./modules/cw-utils/procurement/refreshCatalog";
import { refreshInventory } from "./modules/cw-utils/procurement/refreshInventory";
import { events, setupEventDebugger } from "./modules/globalEvents";
// Setup global event debugger in non-production environments
@@ -14,6 +16,21 @@ setInterval(() => {
return refreshCompanies();
}, 60 * 1000);
// Refresh the internal catalog every minute
await refreshCatalog();
setInterval(() => {
return refreshCatalog();
}, 60 * 1000);
// Refresh inventory on hand every 2 minutes
await refreshInventory();
setInterval(
() => {
return refreshInventory();
},
2 * 60 * 1000,
);
await unifiSites.syncSites();
setInterval(() => {
return unifiSites.syncSites();