Skip to content

Commit 3c582a6

Browse files
fixes redis#2524 delaying graceful exit while pingInterval is set (redis#2525)
* fixes redis#2524 * `clearTimeout` in `disconnect` too --------- Co-authored-by: Leibale Eidelman <me@leibale.com>
1 parent 371b682 commit 3c582a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/client/lib/client/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ export default class RedisClient<
683683

684684
QUIT(): Promise<string> {
685685
return this.#socket.quit(async () => {
686+
if (this.#pingTimer) clearTimeout(this.#pingTimer);
686687
const quitPromise = this.#queue.addCommand<string>(['QUIT']);
687688
this.#tick();
688689
const [reply] = await Promise.all([
@@ -804,6 +805,7 @@ export default class RedisClient<
804805
}
805806

806807
async disconnect(): Promise<void> {
808+
if (this.#pingTimer) clearTimeout(this.#pingTimer);
807809
this.#queue.flushAll(new DisconnectsClientError());
808810
this.#socket.disconnect();
809811
await this.#destroyIsolationPool();

0 commit comments

Comments
 (0)