1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-11 09:22:35 +03:00

fix(sentinel): properly pass reconnectStrategy (#3063)

Properly pass reconnectStrategy to master/replica nodes.
Before that strategies passed in the nodeClientOptions.socket
object were ignored.

fixes #3061
This commit is contained in:
Nikolay Karadzhov
2025-08-20 11:11:34 +03:00
committed by GitHub
parent d5423b93d6
commit e347d566cb

View File

@@ -716,7 +716,7 @@ class RedisSentinelInternal<
); );
} }
#createClient(node: RedisNode, clientOptions: RedisClientOptions, reconnectStrategy?: undefined | false) { #createClient(node: RedisNode, clientOptions: RedisClientOptions, reconnectStrategy?: false) {
return RedisClient.create({ return RedisClient.create({
//first take the globally set RESP //first take the globally set RESP
RESP: this.#RESP, RESP: this.#RESP,
@@ -726,7 +726,7 @@ class RedisSentinelInternal<
...clientOptions.socket, ...clientOptions.socket,
host: node.host, host: node.host,
port: node.port, port: node.port,
reconnectStrategy ...(reconnectStrategy !== undefined && { reconnectStrategy })
} }
}); });
} }