fix uptime tracker?

This commit is contained in:
Marco van Dijk 2023-10-31 21:02:46 +01:00
parent d654a34229
commit abd90259ce

View File

@ -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;