fix psql bug
This commit is contained in:
parent
5c68302b55
commit
870ae7d325
@ -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){
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user