Skip to content

Commit b08fd4c

Browse files
committed
fix(redis): pass full REDIS_URL to all ioredis connections including auth
1 parent 31c0a9f commit b08fd4c

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

packages/backend/src/interface/auth.module.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,12 @@ const JWT_SIGNER_VERIFIER = 'JWT_SIGNER_VERIFIER';
6969
// ── Redis client — URL read via ConfigService, not module-level constant ─
7070
{
7171
provide: REDIS_CLIENT,
72-
useFactory: (config: ConfigService) => {
73-
const url = new URL(
74-
config.get<string>('REDIS_URL') ?? 'redis://localhost:6379',
75-
);
76-
return new Redis({
77-
host: url.hostname,
78-
port: Number(url.port) || 6379,
79-
});
80-
},
72+
useFactory: (config: ConfigService) =>
73+
new Redis(config.get<string>('REDIS_URL') ?? 'redis://localhost:6379', {
74+
family: 0,
75+
maxRetriesPerRequest: null,
76+
enableReadyCheck: false,
77+
}),
8178
inject: [ConfigService],
8279
},
8380

0 commit comments

Comments
 (0)