Skip to content

Commit

Permalink
Improve the problem of lagging or even OOM caused by reactivation aft…
Browse files Browse the repository at this point in the history
…er hanging in the background for a long time
  • Loading branch information
mzzsfy committed Jan 4, 2024
1 parent 5cd7e6a commit 41b6a5e
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions internal/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ const connect = () => {
timerange = val;
updatePlots();
});
setInterval(() => {
if (paused || ws.readyState !== WebSocket.OPEN) {
return
}
updatePlots(PlotsDef.events);
}, 1000)
initDone = true;
return;
}

stats.pushData(data);
if (paused) {
stats.pushData(data);
updatePlots(PlotsDef.events);
return
}
updatePlots(PlotsDef.events);
stats.pushData(data);
}
}

Expand Down Expand Up @@ -139,7 +142,7 @@ theme.updateThemeMode();
$('#color_theme_sw').change(() => {
const themeMode = theme.getThemeMode();
const newTheme = themeMode === "dark" && "light" || "dark";
localStorage.setItem("theme-mode", newTheme);
localStorage.setItem("theme-mode", newTheme);
theme.updateThemeMode();
updatePlotsLayout();
});

0 comments on commit 41b6a5e

Please sign in to comment.