From 9356e7dd4fb16275e21d18a08d8cdf4420da4987 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 5 Jan 2024 20:51:05 +0800 Subject: [PATCH] Update clear stats (#4324) --- server/server.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/server.js b/server/server.js index 95fd8b15d..eeffb0635 100644 --- a/server/server.js +++ b/server/server.js @@ -1491,6 +1491,14 @@ let needSetup = false; log.info("manage", `Clear Statistics User ID: ${socket.userID}`); await R.exec("DELETE FROM heartbeat"); + await R.exec("DELETE FROM stat_daily"); + await R.exec("DELETE FROM stat_hourly"); + await R.exec("DELETE FROM stat_minutely"); + + // Restart all monitors to reset the stats + for (let monitorID in server.monitorList) { + await restartMonitor(socket.userID, monitorID); + } callback({ ok: true,