From a2d95dbce3f534d38eaefa14866c0f438350dde4 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Thu, 12 Sep 2024 11:53:29 -0400 Subject: [PATCH] feature/IO-2742-redis - Checkpoint - clear stage before moving to sub task Signed-off-by: Dave Richer --- server.js | 1 + server/email/tasksEmails.js | 2 ++ 2 files changed, 3 insertions(+) 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); });