Block while connecting, fixing #37
See https://github.com/brianc/node-postgres/issues/81
This commit is contained in:
parent
a307e1434e
commit
e36bfdef5b
@ -47,10 +47,11 @@ var PSQL = function(user_id, db, limit, offset){
|
||||
if (that.client) {
|
||||
return callback(null, that.client);
|
||||
} else {
|
||||
pg.connect(conString, function(err, client){
|
||||
var err = null;
|
||||
var client = new pg.Client(conString);
|
||||
client.connect();
|
||||
that.client = client;
|
||||
return callback(err, client);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user