You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-09 00:22:08 +03:00
* fixes #2524 * `clearTimeout` in `disconnect` too --------- Co-authored-by: Leibale Eidelman <me@leibale.com>
This commit is contained in:
@@ -683,6 +683,7 @@ export default class RedisClient<
|
|||||||
|
|
||||||
QUIT(): Promise<string> {
|
QUIT(): Promise<string> {
|
||||||
return this.#socket.quit(async () => {
|
return this.#socket.quit(async () => {
|
||||||
|
if (this.#pingTimer) clearTimeout(this.#pingTimer);
|
||||||
const quitPromise = this.#queue.addCommand<string>(['QUIT']);
|
const quitPromise = this.#queue.addCommand<string>(['QUIT']);
|
||||||
this.#tick();
|
this.#tick();
|
||||||
const [reply] = await Promise.all([
|
const [reply] = await Promise.all([
|
||||||
@@ -804,6 +805,7 @@ export default class RedisClient<
|
|||||||
}
|
}
|
||||||
|
|
||||||
async disconnect(): Promise<void> {
|
async disconnect(): Promise<void> {
|
||||||
|
if (this.#pingTimer) clearTimeout(this.#pingTimer);
|
||||||
this.#queue.flushAll(new DisconnectsClientError());
|
this.#queue.flushAll(new DisconnectsClientError());
|
||||||
this.#socket.disconnect();
|
this.#socket.disconnect();
|
||||||
await this.#destroyIsolationPool();
|
await this.#destroyIsolationPool();
|
||||||
|
Reference in New Issue
Block a user