From 050425b784b4ac8ed715767fd9d89c6e6e31da53 Mon Sep 17 00:00:00 2001 From: Andrew Houghton Date: Wed, 4 Mar 2015 23:13:57 -0500 Subject: [PATCH] Add missing expectation re: clients.length, don't do unnecessary check for pubsub connection --- index.js | 4 ++-- test/test.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 604a0d9..cb719ca 100644 --- a/index.js +++ b/index.js @@ -67,8 +67,8 @@ Sentinel.prototype.createClientInternal = function(masterName, opts) { var self = this; client.on('end', function() { - // if we're purposefully ending and we're not our pubsub client, forget us - if (this.closing && self.pubsub.indexOf(this) === -1) { + // if we're purposefully ending, forget us + if (this.closing) { var index = self.clients.indexOf(this); if (index !== -1) { self.clients.splice(index, 1); diff --git a/test/test.js b/test/test.js index 7a12b27..99a8528 100644 --- a/test/test.js +++ b/test/test.js @@ -210,6 +210,7 @@ describe('Redis Sentinel tests', function() { redisClient2.end(); instance.reconnectAllClients(); + expect(instance.clients.length).to.equal(2); expect(redisClient2.info()).to.not.be.ok;