process camapign emails in queue (#104)

* process camapign emails in queue

* remove validity

* add bulk queue

* fix typo
This commit is contained in:
KM Koushik
2025-02-08 21:34:48 +11:00
committed by GitHub
parent de85dde705
commit d497c29eba
4 changed files with 152 additions and 71 deletions

View File

@@ -6,6 +6,7 @@ import { getConfigurationSetName } from "~/utils/ses-utils";
import { db } from "../db";
import { sendEmailThroughSes, sendEmailWithAttachments } from "../aws/ses";
import { getRedis } from "../redis";
import { DEFAULT_QUEUE_OPTIONS } from "../queue/queue-constants";
function createQueueAndWorker(region: string, quota: number, suffix: string) {
const connection = getRedis();
@@ -107,7 +108,7 @@ export class EmailQueueService {
queue.add(
emailId,
{ emailId, timestamp: Date.now(), unsubUrl, isBulk },
{ jobId: emailId, delay }
{ jobId: emailId, delay, ...DEFAULT_QUEUE_OPTIONS }
);
}