Merged in release/2024-10-11 (pull request #1815)

release/2024-10-11: Remove Task Emails Cleanup
This commit is contained in:
Dave Richer
2024-10-16 17:19:52 +00:00

View File

@@ -25,28 +25,32 @@ const tasksEmailQueueCleanup = async () => {
} }
}; };
if (process.env.NODE_ENV !== "development") { // if (process.env.NODE_ENV !== "development") {
// Handling SIGINT (e.g., Ctrl+C) // // Handling SIGINT (e.g., Ctrl+C)
process.on("SIGINT", async () => { // process.on("SIGINT", async () => {
await tasksEmailQueueCleanup(); // console.log("Handling SIGNIT For Tasks Cleanup");
process.exit(0); // await tasksEmailQueueCleanup();
}); // process.exit(0);
// Handling SIGTERM (e.g., sent by system shutdown) // });
process.on("SIGTERM", async () => { // // Handling SIGTERM (e.g., sent by system shutdown)
await tasksEmailQueueCleanup(); // process.on("SIGTERM", async () => {
process.exit(0); // console.log("Handling SIGTERM For Tasks Cleanup");
}); // await tasksEmailQueueCleanup();
// Handling uncaught exceptions // process.exit(0);
process.on("uncaughtException", async (err) => { // });
await tasksEmailQueueCleanup(); // // Handling uncaught exceptions
process.exit(1); // process.on("uncaughtException", async (err) => {
}); // console.log("Handling uncaughtException For Tasks Cleanup");
// Handling unhandled promise rejections // await tasksEmailQueueCleanup();
process.on("unhandledRejection", async (reason, promise) => { // process.exit(1);
await tasksEmailQueueCleanup(); // });
process.exit(1); // // Handling unhandled promise rejections
}); // process.on("unhandledRejection", async (reason, promise) => {
} // console.log("Handling unhandledRejection For Tasks Cleanup");
// await tasksEmailQueueCleanup();
// process.exit(1);
// });
// }
/** /**
* Format the date for the email. * Format the date for the email.