Add a reconnection interval constant

This commit is contained in:
2025-09-01 12:06:23 -07:00
parent 051f6c12e7
commit 72b77c3b60
2 changed files with 4 additions and 1 deletions

View File

@@ -21,3 +21,4 @@ export const RATE_LIMIT_DELAY_MULTIPLIER_MS = process.env.RATE_LIMIT_DELAY_MULTI
? parseInt(process.env.RATE_LIMIT_DELAY_MULTIPLIER_MS)
: 1000;
export const REDIS_RECONNECT_INTERVAL = 30000;

View File

@@ -1,4 +1,5 @@
import { createClient } from 'redis';
import { REDIS_RECONNECT_INTERVAL } from "../environment";
export abstract class BaseRedisRepository {
protected redisClient;
@@ -9,7 +10,8 @@ export abstract class BaseRedisRepository {
socket: {
tls: process.env.NODE_ENV === 'production',
rejectUnauthorized: false,
}
reconnectStrategy: REDIS_RECONNECT_INTERVAL,
},
}),
) {
this.redisClient = redisClient;