1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00
This commit is contained in:
Leibale
2023-11-14 20:08:22 -05:00
parent 2ca6e1f333
commit f8c24c0edd

View File

@@ -217,10 +217,11 @@ export default class RedisSocket extends EventEmitter {
}
private _onSocketError(err: Error): void {
const wasReady = this._isReady;
this._isReady = false;
this.emit('error', err);
if (!this._isOpen || typeof this._shouldReconnect(0, err) !== 'number') return;
if (!wasReady || !this._isOpen || typeof this._shouldReconnect(0, err) !== 'number') return;
this.emit('reconnecting');
this._connect().catch(() => {