Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/client/lib/client/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,13 @@ export default class RedisSocket extends EventEmitter {
#onSocketError(err: Error): void {
const wasReady = this.#isReady;
this.#isReady = false;
const socket = this.#socket;
this.#socket = undefined;
Comment thread
cursor[bot] marked this conversation as resolved.
this.emit('error', err);

socket?.removeAllListeners('data');
socket?.destroy();

if (!wasReady || !this.#isOpen || typeof this.#shouldReconnect(0, err) !== 'number') return;

this.emit('reconnecting');
Expand Down