Update Redis configuration to support BullMQ requirements
- Changed `maxRetriesPerRequest` from 3 to null to comply with BullMQ's shared ioredis client requirements. - Ensured proper initialization of Redis connection for improved performance and compatibility.
This commit is contained in:
@@ -6,7 +6,8 @@ const globalForRedis = globalThis as unknown as { __nexumiRedis?: Redis };
|
||||
export const redis: Redis =
|
||||
globalForRedis.__nexumiRedis ??
|
||||
new Redis(env.REDIS_URL, {
|
||||
maxRetriesPerRequest: 3,
|
||||
// BullMQ requires maxRetriesPerRequest: null on shared ioredis clients.
|
||||
maxRetriesPerRequest: null,
|
||||
// Defer the actual TCP connection until the first command is issued.
|
||||
// This keeps module import side-effect free, which matters for
|
||||
// Next.js's build-time "collect page data" step (no network access
|
||||
|
||||
Reference in New Issue
Block a user