fix psql bug

This commit is contained in:
Simon Tokumine 2011-06-16 11:55:36 +02:00
parent 5c68302b55
commit 870ae7d325
2 changed files with 10 additions and 3 deletions

View File

@ -45,7 +45,7 @@ app.get('/v1/', function(req, res){
},
function packageResults(err, result){
if (err) throw err;
//pg.end(); TODO: Fix this - we should use a proper pool?
//pg.end(); //TODO: Fix this - we should use a proper generic pool
res.send(result.rows);
},
function exceptionHandle(err, result){

View File

@ -56,9 +56,16 @@ var PSQL = function(user_id, db){
});
});
};
//https://github.com/brianc/node-postgres/issues/15
me.end = function(){
if (this.client) this.client.end();
this.client.end();
// var that = this;
// if (this.client) {
// (this.client.readyForQuery && this.client.queryQueue.length === 0) ? this.client.end() : this.client.on('drain', function(){
// that.client.end();
// });
// }
}
return me;