@@ -26,9 +26,6 @@ module.exports = {
2626
2727 client . once ( 'error' , onError ) ;
2828
29- //TODO refactor
30- //i don't like reaching into the client's connection for attaching
31- //to specific events here
3229 client . once ( 'connect' , onReady ) ;
3330 }
3431
@@ -41,33 +38,21 @@ module.exports = {
4138 return defaults . poolSize ;
4239 }
4340
44- var log = function ( ) {
45- //do nothing
46- }
47-
48- //for testing
49- // var log = function() {
50- // console.log.apply(console, arguments);
51- // }
52-
5341 var getPooledClient = function ( config , callback ) {
5442 //lookup pool using config as key
5543 //TODO this don't work so hot w/ object configs
5644 var pool = clientPools [ config ] ;
5745
5846 //create pool if doesn't exist
5947 if ( ! pool ) {
60- //log("creating pool %s", config)
6148 pool = clientPools [ config ] = new Pool ( defaults . poolSize , function ( ) {
62- //log("creating new client in pool %s", config)
6349 var client = new Client ( config ) ;
6450 client . connected = false ;
6551 return client ;
6652 } )
6753 }
6854
6955 pool . checkOut ( function ( err , client ) {
70-
7156 //if client already connected just
7257 //pass it along to the callback and return
7358 if ( client . connected ) {
@@ -92,9 +77,6 @@ module.exports = {
9277
9378 client . once ( 'error' , onError ) ;
9479
95- //TODO refactor
96- //i don't like reaching into the client's connection for attaching
97- //to specific events here
9880 client . once ( 'connect' , onReady ) ;
9981
10082 client . connect ( ) ;
0 commit comments