mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-09 23:28:31 +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;
|
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 primaryRedis = buildRedisFromConfig(redisConfigKeys);
|
||||||
const redisReadReplicas = redisConfigKeys.REDIS_READ_REPLICAS?.map((el) => {
|
const redisReadReplicas = redisConfigKeys.REDIS_READ_REPLICAS?.map((el) => {
|
||||||
if (redisConfigKeys.REDIS_URL) {
|
if (redisConfigKeys.REDIS_URL) {
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ export type TRedisConfigKeys = Partial<{
|
|||||||
REDIS_SENTINEL_ENABLE_TLS: boolean;
|
REDIS_SENTINEL_ENABLE_TLS: boolean;
|
||||||
REDIS_SENTINEL_USERNAME: string;
|
REDIS_SENTINEL_USERNAME: string;
|
||||||
REDIS_SENTINEL_PASSWORD: string;
|
REDIS_SENTINEL_PASSWORD: string;
|
||||||
|
|
||||||
REDIS_READ_REPLICAS: { host: string; port: number }[];
|
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export const buildRedisFromConfig = (cfg: TRedisConfigKeys) => {
|
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"
|
query="REDIS_READ_REPLICAS"
|
||||||
type="string"
|
type="string"
|
||||||
default="none"
|
default="none"
|
||||||
required
|
optional
|
||||||
>
|
>
|
||||||
Comma-separated list of Redis read replicas host:port pairs. ```
|
Comma-separated list of Redis read replicas host:port pairs. ```
|
||||||
192.168.65.254:26379,192.168.65.254:26380 ```
|
192.168.65.254:26379,192.168.65.254:26380 ```
|
||||||
</ParamField>
|
</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>
|
</Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
|||||||
Reference in New Issue
Block a user