mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: updated pr by reptile review
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user