diff --git a/src/lib/queue/config.ts b/src/lib/queue/config.ts index cbaeefc..544ffa6 100644 --- a/src/lib/queue/config.ts +++ b/src/lib/queue/config.ts @@ -7,11 +7,15 @@ import { Queue, Worker, QueueOptions } from 'bullmq'; import IORedis from 'ioredis'; // Redis connection -const connection = new IORedis({ - host: process.env.REDIS_HOST || 'localhost', - port: parseInt(process.env.REDIS_PORT || '6379'), - maxRetriesPerRequest: null, -}); +const connection = process.env.REDIS_URL + ? new IORedis(process.env.REDIS_URL, { + maxRetriesPerRequest: null, + }) + : new IORedis({ + host: process.env.REDIS_HOST || 'localhost', + port: parseInt(process.env.REDIS_PORT || '6379'), + maxRetriesPerRequest: null, + }); // Queue options const queueOptions: QueueOptions = {