Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat: added same in sentinel

=f5e3a7015ecc
diff --git a/backend/src/lib/config/redis.ts b/backend/src/lib/config/redis.ts
index 4b3e9f5a58..d67634f0ea 100644
--- a/backend/src/lib/config/redis.ts
+++ b/backend/src/lib/config/redis.ts
@@ -62,6 +62,14 @@ export const buildRedisFromConfig = (cfg: TRedisConfigKeys) => {
sentinelPassword: cfg.REDIS_SENTINEL_PASSWORD,
enableTLSForSentinelMode: cfg.REDIS_SENTINEL_ENABLE_TLS,
username: cfg.REDIS_USERNAME,
- password: cfg.REDIS_PASSWORD
+ password: cfg.REDIS_PASSWORD,
+ reconnectOnError(err) {
+ // Reconnect when hitting a read-only replica during failover
+ const targetError = "READONLY";
+ if (err.message.includes(targetError)) {
+ return true; // Reconnect
+ }
+ return false;
+ }
});
};