Skip to content

Commit

Permalink
fix redis#1330 - revert 8524eea
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale committed May 3, 2021
1 parent aafc349 commit d5eeb5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,14 @@ class Cluster extends EventEmitter {
this.once("close", closeListener);
this.once("close", this.handleCloseEvent.bind(this));

this.refreshSlotsCache();
this.refreshSlotsCache(
function (err) {
if (err && err.message === "Failed to refresh slots cache.") {
Redis.prototype.silentEmit.call(this, "error", err);
this.connectionPool.reset([]);
}
}.bind(this)
);
this.subscriber.start();
})
.catch((err) => {
Expand Down Expand Up @@ -513,8 +520,6 @@ class Cluster extends EventEmitter {
"Failed to refresh slots cache.",
lastNodeError
);
Redis.prototype.silentEmit.call(_this, "error", error);
_this.connectionPool.reset([]);
return wrapper(error);
}
const node = nodes[index];
Expand Down

0 comments on commit d5eeb5e

Please sign in to comment.