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

View File

@@ -1,13 +1,11 @@
import { Queue, type RepeatableJob } from "bullmq";
import IORedis from "ioredis";
import { logger } from "./logger.js";
import type { QueueJob } from "./schema.js";
export const connection = new IORedis(process.env.REDIS_URL!, {
maxRetriesPerRequest: null,
});
export const jobQueue = new Queue("backupQueue", {
connection,
connection: {
url: process.env.REDIS_URL!,
},
defaultJobOptions: {
removeOnComplete: true,
removeOnFail: true,