From 9a113ca2fd173182f5f34b4667e993bc98238933 Mon Sep 17 00:00:00 2001 From: luin Date: Fri, 19 Jul 2019 14:13:13 +0800 Subject: [PATCH] fix(cluster): suppress errors emitted from internal clients Close #896, #899 --- lib/cluster/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/cluster/index.ts b/lib/cluster/index.ts index 9ae7e932..39c97680 100644 --- a/lib/cluster/index.ts +++ b/lib/cluster/index.ts @@ -740,6 +740,11 @@ class Cluster extends EventEmitter { retryStrategy: null, connectionName: "ioredisClusterRefresher" }); + + // Ignore error events since we will handle + // exceptions for the CLUSTER SLOTS command. + duplicatedConnection.on("error", noop); + duplicatedConnection.cluster( "slots", timeout((err, result) => {