Skip to content

Commit bc8abd5

Browse files
fixes #2524 delaying graceful exit while pingInterval is set (#2525)
* fixes #2524 * `clearTimeout` in `disconnect` too --------- Co-authored-by: Leibale Eidelman <[email protected]>
1 parent 259e9b2 commit bc8abd5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/client/lib/client/index.ts

+2
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)