From 38b88739c8f67bb02c0de7174a354e1f83248ac4 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 7 Sep 2025 23:00:41 +0530 Subject: [PATCH] feat: updated pr by reptile review --- backend/src/keystore/keystore.ts | 6 +++++- backend/src/lib/config/redis.ts | 2 -- docs/self-hosting/configuration/envars.mdx | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/src/keystore/keystore.ts b/backend/src/keystore/keystore.ts index 0854c2c71..45589e529 100644 --- a/backend/src/keystore/keystore.ts +++ b/backend/src/keystore/keystore.ts @@ -109,7 +109,11 @@ const pickPrimaryOrSecondaryRedis = (primary: Redis | Cluster, secondaries?: Arr return selectedReplica; }; -export const keyStoreFactory = (redisConfigKeys: TRedisConfigKeys): TKeyStoreFactory => { +interface TKeyStoreFactoryDTO extends TRedisConfigKeys { + REDIS_READ_REPLICAS?: { host: string; port: number }[]; +} + +export const keyStoreFactory = (redisConfigKeys: TKeyStoreFactoryDTO): TKeyStoreFactory => { const primaryRedis = buildRedisFromConfig(redisConfigKeys); const redisReadReplicas = redisConfigKeys.REDIS_READ_REPLICAS?.map((el) => { if (redisConfigKeys.REDIS_URL) { diff --git a/backend/src/lib/config/redis.ts b/backend/src/lib/config/redis.ts index 8e375ab62..5187f740a 100644 --- a/backend/src/lib/config/redis.ts +++ b/backend/src/lib/config/redis.ts @@ -15,8 +15,6 @@ export type TRedisConfigKeys = Partial<{ REDIS_SENTINEL_ENABLE_TLS: boolean; REDIS_SENTINEL_USERNAME: string; REDIS_SENTINEL_PASSWORD: string; - - REDIS_READ_REPLICAS: { host: string; port: number }[]; }>; export const buildRedisFromConfig = (cfg: TRedisConfigKeys) => { diff --git a/docs/self-hosting/configuration/envars.mdx b/docs/self-hosting/configuration/envars.mdx index e966d4460..8d351d7f2 100644 --- a/docs/self-hosting/configuration/envars.mdx +++ b/docs/self-hosting/configuration/envars.mdx @@ -208,13 +208,13 @@ Redis is used for caching and background tasks. You can use either a standalone query="REDIS_READ_REPLICAS" type="string" default="none" - required + optional > Comma-separated list of Redis read replicas host:port pairs. ``` 192.168.65.254:26379,192.168.65.254:26380 ``` - The rest of the parameters of the primary instance will be inherited. + The paramters like username, password, tls, redis type of the primary instance will be inherited.