From eb7f77167ceaa7d4d194bc228031153d2ebb5c11 Mon Sep 17 00:00:00 2001 From: Ryderjj89 Date: Mon, 26 May 2025 13:01:21 -0400 Subject: [PATCH] Update event conclusion email schedule and add logging --- backend/src/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 1d4e58d..bebf469 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -967,11 +967,16 @@ async function sendConclusionEmails() { } -// Schedule the task to run daily (e.g., at 1:00 AM) -cron.schedule('0 1 * * *', () => { +// Schedule the task to run daily (e.g., at 8:00 AM) +const scheduledTask = cron.schedule('0 8 * * *', () => { sendConclusionEmails(); +}, { + scheduled: true, + timezone: process.env.TZ || 'UTC' // Use TZ environment variable, default to UTC }); +console.log(`Event conclusion email scheduled task scheduled for ${scheduledTask.options.timezone} at ${scheduledTask.options.recoverMissedExecutions ? 'a time based on missed executions' : 'the specified cron pattern'}.`); + // Handle client-side routing app.get('*', (req: Request, res: Response) => {