Fix error event handling for pooled clients
Do not emit error events if no listeners are present
This commit is contained in:
parent
218150466f
commit
6b7906ce99
|
@ -47,7 +47,9 @@ function createPool(options, clientpool) {
|
|||
client.on('error', function (err) {
|
||||
client.removeAllListeners('connect');
|
||||
client.removeAllListeners('connectTimeout');
|
||||
clientpool.emit('error', err);
|
||||
if (clientpool.listeners('error').length) {
|
||||
clientpool.emit('error', err);
|
||||
}
|
||||
return callback(err);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue