Skip to content

Commit

Permalink
Add missing expectation re: clients.length, don't do unnecessary check
Browse files Browse the repository at this point in the history
for pubsub connection
  • Loading branch information
Andrew Houghton committed Mar 5, 2015
1 parent 0e77c0c commit 050425b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 050425b

Please sign in to comment.