Skip to content

Commit e347d56

Browse files
authored
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
1 parent d5423b9 commit e347d56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/client/lib/sentinel/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ class RedisSentinelInternal<
716716
);
717717
}
718718

719-
#createClient(node: RedisNode, clientOptions: RedisClientOptions, reconnectStrategy?: undefined | false) {
719+
#createClient(node: RedisNode, clientOptions: RedisClientOptions, reconnectStrategy?: false) {
720720
return RedisClient.create({
721721
//first take the globally set RESP
722722
RESP: this.#RESP,
@@ -726,7 +726,7 @@ class RedisSentinelInternal<
726726
...clientOptions.socket,
727727
host: node.host,
728728
port: node.port,
729-
reconnectStrategy
729+
...(reconnectStrategy !== undefined && { reconnectStrategy })
730730
}
731731
});
732732
}

0 commit comments

Comments
 (0)