import Redis from 'ioredis'; const redisUrl = process.env.REDIS_URL || 'redis://127.0.0.1:6379'; // ioredis default `maxRetriesPerRequest` is not null; BullMQ requires it to be null. // Create a shared connection with `maxRetriesPerRequest: null` to be compatible with BullMQ. export const redisConnection = new Redis(redisUrl, { maxRetriesPerRequest: null }); export default redisConnection;