Skip to content

Commit f368c8a

Browse files
authored
fix(Cluster): ignore connection errors for subscriber. (#790)
The errors will be caught by connection pool and a new election will be made when the current subscriber is lost, so we can safely ignore these errors. Fix #768
1 parent fbcf692 commit f368c8a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/cluster/ClusterSubscriber.ts

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ export default class ClusterSubscriber {
7474
lazyConnect: true
7575
})
7676

77+
// Ignore the errors since they're handled in the connection pool.
78+
this.subscriber.on('error', noop)
79+
7780
// Re-subscribe previous channels
7881
var previousChannels = { subscribe: [], psubscribe: [] }
7982
if (lastActiveSubscriber) {

0 commit comments

Comments
 (0)