From 36dbd1e9a90ee6ecbc174630be4bb53901d4b8f1 Mon Sep 17 00:00:00 2001 From: Joren Vandeweyer Date: Mon, 5 Jun 2023 19:55:06 +0200 Subject: [PATCH 1/2] fixes #2524 --- packages/client/lib/client/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/lib/client/index.ts b/packages/client/lib/client/index.ts index 5b9badf3f37..e27d1c35493 100644 --- a/packages/client/lib/client/index.ts +++ b/packages/client/lib/client/index.ts @@ -683,6 +683,7 @@ export default class RedisClient< QUIT(): Promise { return this.#socket.quit(async () => { + if (this.#pingTimer) clearTimeout(this.#pingTimer); const quitPromise = this.#queue.addCommand(['QUIT']); this.#tick(); const [reply] = await Promise.all([ From 4ea49d538af9d72e30c370da80e748fcaa9917d5 Mon Sep 17 00:00:00 2001 From: Leibale Eidelman Date: Wed, 7 Jun 2023 11:47:54 -0400 Subject: [PATCH 2/2] `clearTimeout` in `disconnect` too --- packages/client/lib/client/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/lib/client/index.ts b/packages/client/lib/client/index.ts index e27d1c35493..90cdbd09111 100644 --- a/packages/client/lib/client/index.ts +++ b/packages/client/lib/client/index.ts @@ -805,6 +805,7 @@ export default class RedisClient< } async disconnect(): Promise { + if (this.#pingTimer) clearTimeout(this.#pingTimer); this.#queue.flushAll(new DisconnectsClientError()); this.#socket.disconnect(); await this.#destroyIsolationPool();