Skip to content

Commit 0b7f3ec

Browse files
committed
test: memorydb failover settings
1 parent b585172 commit 0b7f3ec

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/backend/src/config/redis.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function reconnectOnError(err: Error) {
1919
if (err.message.includes(targetError)) {
2020
// Only reconnect when the error contains "READONLY"
2121
// during node failover, this is thrown: 149: -READONLY You can't write against a read only replica.
22-
return true
22+
return 2 // TEST: ioredis resend the failed command after reconnecting
2323
}
2424
return false
2525
}
@@ -35,6 +35,10 @@ export const createRedisClient = (db = REDIS_DB_INDEX.JOBS) =>
3535
],
3636
{
3737
dnsLookup: (address, callback) => callback(null, address),
38+
39+
// TEST: Handle individual node failovers during MemoryDB updates
40+
retryDelayOnFailover: 100,
41+
3842
redisOptions: {
3943
tls: appConfig.redisTls ? {} : undefined,
4044
username: appConfig.redisUsername,

0 commit comments

Comments
 (0)