Skip to content

Commit

Permalink
remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rcanedo committed Oct 8, 2012
1 parent add3742 commit f83ee15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions lib/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ function ConnectionPool(poolConfig, connectionConfig) {
connection = new PooledConnection(connectionConfig);
connection.on('connect', function(err) {
if (err) {

callback(err,null);
}
else {
connection.on('release', function() {
console.log("on release");
self.pool.release(connection);
});
callback(null, connection);
Expand All @@ -41,8 +40,6 @@ function ConnectionPool(poolConfig, connectionConfig) {
idleTimeoutMillis: poolConfig.idleTimeoutMillis || 30000
};
this.pool = PoolModule.Pool(param);


}
module.exports = ConnectionPool;

Expand All @@ -51,10 +48,10 @@ ConnectionPool.prototype.requestConnection = function(callback) {
var self = this;
this.pool.acquire(function(err, connection) {
if(err) {
callback(err, undefined);
callback(err, null);
}
else {
callback(undefined, connection);
callback(null, connection);
connection.emit('connect');
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/pooled-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function PooledConnection(config) {
util.inherits(PooledConnection, Connection);

PooledConnection.prototype.close = function() {
this.emit('release');
this.emit('release');//used by the pool
this.emit('end');
}

Expand Down

0 comments on commit f83ee15

Please sign in to comment.