Skip to content
Browse files

Adding a fix for timeouts, return reply not available when there is n…

…o further client in pool and clients
  • Loading branch information...
1 parent ffff16a commit 2d276013ac43b976c1796578d9445b7823e3662e @calvinfo calvinfo committed Sep 27, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/pool.js
View
8 lib/pool.js
@@ -69,7 +69,7 @@ util.inherits(Pool, process.EventEmitter);
* @param {Function} callback The callback to invoke when all connections have been made
*/
Pool.prototype.connect = function(callback){
- var i = 0, finished = 0, self = this,
+ var i = 0, finished = 0, self = this,
len = this.hosts.length * this.hostPoolSize,
connected = 0;
@@ -82,12 +82,12 @@ Pool.prototype.connect = function(callback){
connected += 1;
self.clients.push(connection);
}
-
+
if(finished === len){
if(self.clients.length === 0){
- replyNotAvailable(callback);
+ return replyNotAvailable(callback);
}
-
+
//set the keyspaces connection to be the pool
if(keyspace){
keyspace.connection = self;

0 comments on commit 2d27601

Please sign in to comment.
Something went wrong with that request. Please try again.