fix(monitoring): дедупликация точек в истории метрик

addToAllHistory не добавляет повторяющиеся timestamp+node.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-13 17:54:24 +03:00
parent bc20deac23
commit 874d9099de
+4
View File
@@ -56,6 +56,10 @@ export const useMetricsStore = create<MetricsState>((set, get) => ({
addToAllHistory: (metric) =>
set((state) => {
const key = `${metric.node}|${metric.timestamp}`;
if (state.allHistory.some((m) => `${m.node}|${m.timestamp}` === key)) {
return state;
}
const newAll = [...state.allHistory, metric].slice(-MAX_HISTORY);
return { allHistory: newAll };
}),