refactor: single account-level SSE stream instead of per-monitor connections
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user