From 064cf15a354334ebb341c896538f170bdba45034 Mon Sep 17 00:00:00 2001 From: Elijah Date: Sun, 10 Dec 2023 14:51:48 -0500 Subject: [PATCH] update --- src/VM.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/VM.ts b/src/VM.ts index f02052f..f8e7455 100644 --- a/src/VM.ts +++ b/src/VM.ts @@ -91,11 +91,12 @@ export default class VM { return; } var msg = msgpack.decode(payload) as protocol.ProtocolMessage; + if (this.#nopTimeout) clearInterval(this.#nopTimeout); + this.#nopTimeout = setInterval(() => this.#nopTimeoutFunc(), 5000); if (!this.isConnectedToVM) { if (this.#fileQueue.size > 0) this.fileQueueLoop(); this.isConnectedToVM = true; this.#noNop = false; - this.#nopTimeout = setInterval(() => this.#nopTimeoutFunc(), 5000); } switch (msg.Operation) { case protocol.ProtocolOperation.ACK: @@ -114,6 +115,7 @@ export default class VM { this.#noNop = true; } else { this.isConnectedToVM = false; + clearInterval(this.#nopTimeout!); } } }