feat: updated pr by reptile review

This commit is contained in:
=
2025-09-07 23:00:41 +05:30
parent 0502dc60a6
commit 38b88739c8
3 changed files with 7 additions and 5 deletions

View File

@@ -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) {

View File

@@ -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) => {

View File

@@ -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 ```
</ParamField>
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.
</Tab>
</Tabs>