diff --git a/server/notifications/queues/appQueue.js b/server/notifications/queues/appQueue.js index 1f198698c..f16fe3a64 100644 --- a/server/notifications/queues/appQueue.js +++ b/server/notifications/queues/appQueue.js @@ -288,7 +288,7 @@ const dispatchAppsToQueue = async ({ appsToDispatch }) => { await appQueue.add( "add-notification", { jobId, bodyShopId, key, variables, recipients, body, jobRoNumber }, - { jobId: `${jobId}:${Date.now()}` } + { jobId: `${jobId}-${Date.now()}` } ); devDebugLogger(`Added notification to queue for jobId ${jobId} with ${recipients.length} recipients`); } diff --git a/server/notifications/queues/emailQueue.js b/server/notifications/queues/emailQueue.js index 7d965cb69..f4f968478 100644 --- a/server/notifications/queues/emailQueue.js +++ b/server/notifications/queues/emailQueue.js @@ -249,10 +249,15 @@ const dispatchEmailsToQueue = async ({ emailsToDispatch, logger }) => { continue; } - await emailAddQueue.add( - "add-email-notification", - { jobId, jobRoNumber, bodyShopName, bodyShopTimezone, body, recipients }, - { jobId: `${jobId}:${Date.now()}` } + await emailConsolidateQueue.add( + "consolidate-emails", + { jobId, jobRoNumber, bodyShopName, bodyShopTimezone }, + { + jobId: `consolidate-${jobId}`, + delay: EMAIL_CONSOLIDATION_DELAY, + attempts: 3, + backoff: LOCK_EXPIRATION + } ); devDebugLogger(`Added email notification to queue for jobId ${jobId} with ${recipients.length} recipients`); }