1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-09 21:21:11 +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({
//first take the globally set RESP
RESP: this.#RESP,
@@ -726,7 +726,7 @@ class RedisSentinelInternal<
...clientOptions.socket,
host: node.host,
port: node.port,
reconnectStrategy
...(reconnectStrategy !== undefined && { reconnectStrategy })
}
});
}