Version
This commit is contained in:
+18
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user