You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Fix race condition when slots are re-calculated (#2731)
This commit is contained in:
@@ -158,13 +158,13 @@ export default class RedisClusterSlots<
|
||||
}
|
||||
|
||||
async #discover(rootNode?: RedisClusterClientOptions) {
|
||||
this.#resetSlots();
|
||||
const addressesInUse = new Set<string>();
|
||||
|
||||
try {
|
||||
const shards = await this.#getShards(rootNode),
|
||||
promises: Array<Promise<unknown>> = [],
|
||||
eagerConnect = this.#options.minimizeConnections !== true;
|
||||
this.#resetSlots();
|
||||
for (const { from, to, master, replicas } of shards) {
|
||||
const shard: Shard<M, F, S> = {
|
||||
master: this.#initiateSlotNode(master, false, eagerConnect, addressesInUse, promises)
|
||||
|
Reference in New Issue
Block a user