Skip to content

Commit

Permalink
fix #2443 - fix multiple sockets on error in socket initiator
Browse files Browse the repository at this point in the history
  • Loading branch information
leibale committed Apr 24, 2023
1 parent c88dea6 commit cba6dc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/client/lib/client/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default class RedisSocket extends EventEmitter {
.off('error', reject)
.once('error', (err: Error) => this.#onSocketError(err))
.once('close', hadError => {
if (!hadError && this.#isOpen && this.#socket === socket) {
if (!hadError && this.#isReady && this.#socket === socket) {
this.#onSocketError(new SocketClosedUnexpectedlyError());
}
})
Expand Down

0 comments on commit cba6dc5

Please sign in to comment.