From 0748fb0214298f7629e9aaa731208ee88915aae9 Mon Sep 17 00:00:00 2001 From: linanw Date: Tue, 22 Sep 2020 17:21:26 +0800 Subject: [PATCH] clear statusloop interval before set it Everytime grbl restarts, welcome message (with "Grbl" it) will trigger setting the statusloop, without clear the loop previously set. stopPort() only clear the last one, but leftover rest of them. Adding clearInterval right before setInterval to ensure single statusloop. Co-Authored-By: AqeeAqee <25360426+aqeeaqee@users.noreply.github.com> --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 6b564e9..9c4da68 100644 --- a/index.js +++ b/index.js @@ -974,6 +974,7 @@ io.on("connection", function(socket) { io.sockets.emit('grbl') }, 600) // Start interval for status queries + clearInterval(statusLoop); statusLoop = setInterval(function() { if (status.comms.connectionStatus > 0) { addQRealtime("?");