Implemented ping type for monitors, added cleanup for job queue

This commit is contained in:
Alex Holliday committed 2024-06-14 14:31:07 -07:00
1 parent f3de5ce381
commit f9f73dbc47
6 files changed
+58 -4

No files matched your search

+10
View File
@@ -93,6 +93,16 @@ const startApp = async () => {
await connectDbAndRunServer(app, db);
const jobQueue = await JobQueue.createJobQueue(db);
const cleanup = async () => {
console.log("Shutting down gracefully");
await jobQueue.obliterate();
console.log("Finished cleanup");
process.exit(0);
};
process.on("SIGINT", cleanup);
process.on("SIGTERM", cleanup);
};
startApp().catch((error) => {