diff --git a/server.js b/server.js index b9f32f213..98e20fa9d 100644 --- a/server.js +++ b/server.js @@ -110,6 +110,7 @@ const applySocketIO = async (server, app) => { } process.on("SIGINT", async () => { + logger.log("Closing Redis connections...", "INFO", "redis", "api"); await Promise.all([pubClient.disconnect(), subClient.disconnect()]); process.exit(0); }); diff --git a/server/email/tasksEmails.js b/server/email/tasksEmails.js index aac9ebf4f..853a2e2b7 100644 --- a/server/email/tasksEmails.js +++ b/server/email/tasksEmails.js @@ -41,9 +41,11 @@ const tasksEmailQueueCleanup = async () => { } }; +// TODO: Consolidate into a group that can be run (multiple events with the same name) if (process.env.NODE_ENV !== "development") { // Handling SIGINT (e.g., Ctrl+C) process.on("SIGINT", async () => { + logger.log("Clearing Tasks Email Queue...", "INFO", "redis", "api"); await tasksEmailQueueCleanup(); process.exit(0); });