Comparing version 1.0.2 to 1.1.0
@@ -56,4 +56,4 @@ var _ = require('lodash'); | ||
var servers = this._servers; | ||
var len = servers.length; | ||
if (len === 0) { | ||
var l = servers.length; | ||
if (l === 0) { | ||
var err = new Error('No connections'); | ||
@@ -63,3 +63,3 @@ cb(err); | ||
} | ||
var index = _.random(0, len - 1); | ||
var index = _.random(0, l - 1); | ||
var server = servers[index]; | ||
@@ -76,2 +76,7 @@ var conn = this._conns[server]; | ||
var l = servers.length; | ||
if (l === 0) { | ||
var err = new Error('No connections'); | ||
cb(err); | ||
return; | ||
} | ||
var hanlder = new this._McRedisGetHanlder(l, cb); | ||
@@ -78,0 +83,0 @@ var handle = _.bind(hanlder.handle, hanlder); |
{ | ||
"name": "mc-redis", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5523
184