Skip to content

Commit 0d19522

Browse files
committed
code cleanup
1 parent 26a8510 commit 0d19522

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

lib/client-pool.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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();

lib/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
defaults: defaults
1212
}
1313

14+
//lazy require native as it may not have been built
1415
module.exports.__defineGetter__("native", function() {
1516
return require(__dirname + '/native');
1617
})

0 commit comments

Comments
 (0)