Block while connecting, fixing #37

See https://github.com/brianc/node-postgres/issues/81
This commit is contained in:
Sandro Santilli 2012-07-12 20:13:47 +02:00
parent a307e1434e
commit e36bfdef5b

View File

@ -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);
});
}
};