1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

clean code

This commit is contained in:
leibale
2022-01-03 16:37:03 -05:00
parent 7e2059b1cf
commit 24f3e3f43c

View File

@@ -268,10 +268,10 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
.on('data', data => this.#queue.parseResponse(data))
.on('error', err => {
this.emit('error', err);
if (!this.#socket.isOpen) {
this.#queue.flushAll(err);
} else {
if (this.#socket.isOpen) {
this.#queue.flushWaitingForReply(err);
} else {
this.#queue.flushAll(err);
}
})
.on('connect', () => this.emit('connect'))