refactor: update ioredis connection

This commit is contained in:
Mauricio Siu
2024-10-06 02:44:35 -06:00
parent ed8d32d050
commit 9e4bac1386
4 changed files with 16 additions and 14 deletions

View File

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