Skip to content

Commit cba6dc5

Browse files
authored
fix #2443 - fix multiple sockets on error in socket initiator
1 parent c88dea6 commit cba6dc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/client/lib/client/socket.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export default class RedisSocket extends EventEmitter {
199199
.off('error', reject)
200200
.once('error', (err: Error) => this.#onSocketError(err))
201201
.once('close', hadError => {
202-
if (!hadError && this.#isOpen && this.#socket === socket) {
202+
if (!hadError && this.#isReady && this.#socket === socket) {
203203
this.#onSocketError(new SocketClosedUnexpectedlyError());
204204
}
205205
})

0 commit comments

Comments
 (0)