mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: update ioredis connection
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { type Job, Worker } from "bullmq";
|
||||
import type { QueueJob } from "./schema";
|
||||
import { runJobs } from "./utils";
|
||||
import Redis from "ioredis";
|
||||
import { connection } from "./queue";
|
||||
|
||||
export const firstWorker = new Worker(
|
||||
"backupQueue",
|
||||
@@ -10,9 +12,7 @@ export const firstWorker = new Worker(
|
||||
},
|
||||
{
|
||||
concurrency: 50,
|
||||
connection: {
|
||||
host: process.env.REDIS_URL,
|
||||
},
|
||||
connection,
|
||||
},
|
||||
);
|
||||
export const secondWorker = new Worker(
|
||||
@@ -23,8 +23,6 @@ export const secondWorker = new Worker(
|
||||
},
|
||||
{
|
||||
concurrency: 50,
|
||||
connection: {
|
||||
host: process.env.REDIS_URL,
|
||||
},
|
||||
connection,
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user