fix(schedules): ensure cronSchedule is always a string when removing jobs

- Updated the job removal logic to default cronSchedule to an empty string if job.pattern is undefined, preventing potential errors during job removal.
This commit is contained in:
Mauricio Siu
2026-02-07 01:42:14 -06:00
parent 26d4058457
commit 425bcf8958
3 changed files with 16 additions and 13 deletions
+9 -4
View File
@@ -1,6 +1,5 @@
import { type Job, Worker } from "bullmq";
import { logger } from "./logger.js";
import { connection } from "./queue.js";
import type { QueueJob } from "./schema.js";
import { runJobs } from "./utils.js";
@@ -12,7 +11,9 @@ export const firstWorker = new Worker(
},
{
concurrency: 100,
connection,
connection: {
url: process.env.REDIS_URL!,
},
},
);
export const secondWorker = new Worker(
@@ -23,7 +24,9 @@ export const secondWorker = new Worker(
},
{
concurrency: 100,
connection,
connection: {
url: process.env.REDIS_URL!,
},
},
);
@@ -35,6 +38,8 @@ export const thirdWorker = new Worker(
},
{
concurrency: 100,
connection,
connection: {
url: process.env.REDIS_URL!,
},
},
);