Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clear stats #4324

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we want to start all monitors here? Function restartMonitor is calling startMonitor, so this will also start paused monitors

await restartMonitor(socket.userID, monitorID);
}

callback({
ok: true,
Expand Down