From abd90259cee75eb0cfd742e120d667a0990aedb1 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Tue, 31 Oct 2023 21:02:46 +0100 Subject: [PATCH] fix uptime tracker? --- master/src/routes/master.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/master/src/routes/master.js b/master/src/routes/master.js index 09fb599..ce7f2a6 100644 --- a/master/src/routes/master.js +++ b/master/src/routes/master.js @@ -182,13 +182,13 @@ masterRouter.post("/collectStats", async (req, res) => { let pingpoints = 0; for (const thisData of currentDataList) { // Count ping* vars - if (thisData.latency) { + if (thisData.latency && thisData.latency != null) { pingsum += thisData.latency; pingpoints += 1; } // Only count *time vars if we have timestamps if (prevtime && thisData.timestamp) { - if (thisData.latency) { + if (thisData.latency && thisData.latency != null && thisData.latency < 1000) { uptime += thisData.timestamp - prevtime; } else { downtime += thisData.timestamp - prevtime;