Implemented ping type for monitors, added cleanup for job queue
This commit is contained in:
1 parent
f3de5ce381
commit
f9f73dbc47
6 files changed
+58
-4
No files matched your search
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user