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) {
|
if (that.client) {
|
||||||
return callback(null, that.client);
|
return callback(null, that.client);
|
||||||
} else {
|
} else {
|
||||||
pg.connect(conString, function(err, client){
|
var err = null;
|
||||||
that.client = client;
|
var client = new pg.Client(conString);
|
||||||
return callback(err, client);
|
client.connect();
|
||||||
});
|
that.client = client;
|
||||||
|
return callback(err, client);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user