perf(web): pause hidden live polling

This commit is contained in:
lingniu
2026-07-16 08:35:37 +08:00
parent e06778e38c
commit 4c54cfa6ff
9 changed files with 46 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ import { api } from '../../api/client';
import type { HistoryDataResponse, HistoryDataRow, HistoryExportRequest, HistoryMetricDefinition, HistorySeriesResponse } from '../../api/types';
import { buildHistorySeriesPanels, formatExportFileSize, formatHistoryValue, formatSeriesGrain, historyExportPollInterval, parseHistoryKeywords } from '../domain/history';
import { InlineError } from '../shared/AsyncState';
import { QUERY_MEMORY, retainPreviousPageWithinScope } from '../queryPolicy';
import { LIVE_QUERY_POLICY, QUERY_MEMORY, retainPreviousPageWithinScope } from '../queryPolicy';
import { usePlatformSession } from '../auth/AuthGate';
import { canOperate } from '../auth/session';
@@ -50,7 +50,7 @@ function ExportJobsPanel() {
queryKey: ['history-exports'],
queryFn: ({ signal }) => api.historyExports(signal),
refetchInterval: (current) => historyExportPollInterval(current.state.data),
refetchIntervalInBackground: false,
...LIVE_QUERY_POLICY,
gcTime: QUERY_MEMORY.highVolumeGcTime
});
const jobs = query.data ?? [];