Merge pull request #620 from Jarvix/timeout_error_fix
Pool: Only call destroy on a client when it is not already being destroyed
This commit is contained in:
commit
be73773d36
@ -30,7 +30,13 @@ var pools = {
|
||||
//via the pg object and then removing errored client from the pool
|
||||
client.on('error', function(e) {
|
||||
pool.emit('error', e, client);
|
||||
pool.destroy(client);
|
||||
|
||||
// If the client is already being destroyed, the error
|
||||
// occurred during stream ending. Do not attempt to destroy
|
||||
// the client again.
|
||||
if (!client._destroying) {
|
||||
pool.destroy(client);
|
||||
}
|
||||
});
|
||||
|
||||
// Remove connection from pool on disconnect
|
||||
|
Loading…
Reference in New Issue
Block a user