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:
parent
ed8d32d050
commit
9e4bac1386
@ -7,6 +7,7 @@
|
||||
"start": "node --experimental-specifier-resolution=node dist/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"ioredis": "5.4.1",
|
||||
"bullmq": "5.4.2",
|
||||
"@hono/zod-validator": "0.3.0",
|
||||
"zod": "^3.23.4",
|
||||
@ -17,8 +18,7 @@
|
||||
"hono": "^4.5.8",
|
||||
"dotenv": "^16.3.1",
|
||||
"pino": "9.4.0",
|
||||
"pino-pretty": "11.2.2",
|
||||
"redis": "4.7.0"
|
||||
"pino-pretty": "11.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.4.2",
|
||||
|
@ -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,
|
||||
},
|
||||
);
|
||||
|
@ -465,6 +465,9 @@ importers:
|
||||
hono:
|
||||
specifier: ^4.5.8
|
||||
version: 4.5.8
|
||||
ioredis:
|
||||
specifier: 5.4.1
|
||||
version: 5.4.1
|
||||
pino:
|
||||
specifier: 9.4.0
|
||||
version: 9.4.0
|
||||
@ -477,9 +480,6 @@ importers:
|
||||
react-dom:
|
||||
specifier: 18.2.0
|
||||
version: 18.2.0(react@18.2.0)
|
||||
redis:
|
||||
specifier: 4.7.0
|
||||
version: 4.7.0
|
||||
zod:
|
||||
specifier: ^3.23.4
|
||||
version: 3.23.8
|
||||
|
Loading…
Reference in New Issue
Block a user