From 41afedd02ce65308f917417dc90f018de4cb1f91 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 10 Oct 2025 15:58:32 -0400 Subject: [PATCH 1/2] Change Delemiters in BullMQ, was using an invalid : --- server/notifications/queues/appQueue.js | 2 +- server/notifications/queues/emailQueue.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) 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`); } From 8e6c809fc646cde0afd09697142cf60680e2f5ea Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 10 Oct 2025 16:02:56 -0400 Subject: [PATCH 2/2] Update --- server/notifications/queues/appQueue.js | 2 +- server/notifications/queues/emailQueue.js | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/server/notifications/queues/appQueue.js b/server/notifications/queues/appQueue.js index f16fe3a64..b376b2cf6 100644 --- a/server/notifications/queues/appQueue.js +++ b/server/notifications/queues/appQueue.js @@ -92,7 +92,7 @@ const loadAppQueue = async ({ pubClient, logger, redisHelpers, ioRedis }) => { "consolidate-notifications", { jobId, recipients }, { - jobId: `consolidate:${jobId}`, + jobId: `consolidate-${jobId}`, delay: APP_CONSOLIDATION_DELAY, attempts: 3, backoff: LOCK_EXPIRATION diff --git a/server/notifications/queues/emailQueue.js b/server/notifications/queues/emailQueue.js index f4f968478..a5ad8a530 100644 --- a/server/notifications/queues/emailQueue.js +++ b/server/notifications/queues/emailQueue.js @@ -86,7 +86,7 @@ const loadEmailQueue = async ({ pubClient, logger }) => { "consolidate-emails", { jobId, jobRoNumber, bodyShopName, bodyShopTimezone }, { - jobId: `consolidate:${jobId}`, + jobId: `consolidate-${jobId}`, delay: EMAIL_CONSOLIDATION_DELAY, attempts: 3, backoff: LOCK_EXPIRATION @@ -249,15 +249,10 @@ const dispatchEmailsToQueue = async ({ emailsToDispatch, logger }) => { continue; } - await emailConsolidateQueue.add( - "consolidate-emails", - { jobId, jobRoNumber, bodyShopName, bodyShopTimezone }, - { - jobId: `consolidate-${jobId}`, - delay: EMAIL_CONSOLIDATION_DELAY, - attempts: 3, - backoff: LOCK_EXPIRATION - } + await emailAddQueue.add( + "add-email-notification", + { jobId, jobRoNumber, bodyShopName, bodyShopTimezone, body, recipients }, + { jobId: `${jobId}-${Date.now()}` } ); devDebugLogger(`Added email notification to queue for jobId ${jobId} with ${recipients.length} recipients`); }