refactor: single account-level SSE stream instead of per-monitor connections

This commit is contained in:
M1
2026-03-17 07:06:09 +04:00
parent 55f9f6d8ed
commit 66b368453d
4 changed files with 32 additions and 35 deletions
+3 -2
View File
@@ -265,9 +265,10 @@
}
});
// SSE: on each ping, refresh the chart (debounced — at most once per 5s)
// SSE: account stream filtered to this monitor — refresh chart on ping
let _chartRefreshTimer = null;
watchMonitor(monitorId, () => {
watchAccount((ping) => {
if (ping.monitor_id !== monitorId) return;
if (_chartRefreshTimer) return;
_chartRefreshTimer = setTimeout(async () => {
_chartRefreshTimer = null;