mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-25 16:03:13 +00:00
clear deprecation warning on client error - fix test race
This commit is contained in:
parent
cc84799c7a
commit
5c95886749
@ -80,11 +80,17 @@ var oldConnect = function(pool, client, cb) {
|
||||
var tid = setTimeout(function() {
|
||||
console.error(errorMessage);
|
||||
}, alarmDuration);
|
||||
var onError = function() {
|
||||
clearTimeout(tid);
|
||||
client.removeListener('drain', release);
|
||||
};
|
||||
var release = function() {
|
||||
clearTimeout(tid);
|
||||
pool.release(client);
|
||||
client.removeListener('error', onError);
|
||||
};
|
||||
client.once('drain', release);
|
||||
client.once('error', onError);
|
||||
cb(null, client);
|
||||
};
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ helper.pg.connect(helper.config, assert.success(function(client) {
|
||||
assert.ok(error);
|
||||
assert.ok(brokenClient);
|
||||
assert.equal(client.id, brokenClient.id);
|
||||
client.emit('drain');
|
||||
helper.pg.end();
|
||||
});
|
||||
//kill the connection from client
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user