feature/IO-2742-redis - Checkpoint - clear stage before moving to sub task

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-09-12 11:53:29 -04:00
parent 51c181dab7
commit a2d95dbce3
2 changed files with 3 additions and 0 deletions

View File

@@ -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);
});

View File

@@ -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);
});