Skip to content

Commit 61cd168

Browse files
committed
fix: use skipPollingIfUnfocused
1 parent c8faef4 commit 61cd168

File tree

38 files changed

+78
-50
lines changed

38 files changed

+78
-50
lines changed

src/components/MetricChart/MetricChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export const MetricChart = ({
146146
timeFrame,
147147
maxDataPoints: width / 2,
148148
},
149-
{pollingInterval: autorefresh},
149+
{pollingInterval: autorefresh, skipPollingIfUnfocused: true},
150150
);
151151

152152
const loading = isFetching && !currentData;

src/components/PaginatedTable/TableChunk.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const TableChunk = typedMemo(function TableChunk<T, F>({
7373
tableDataApi.useFetchTableChunkQuery(queryParams, {
7474
skip: isTimeoutActive || !isActive,
7575
pollingInterval: autoRefreshInterval,
76+
skipPollingIfUnfocused: true,
7677
});
7778

7879
const {currentData, error} = tableDataApi.endpoints.fetchTableChunk.useQueryState(queryParams);

src/containers/Clusters/Clusters.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export function Clusters() {
4040
const [autoRefreshInterval] = useAutoRefreshInterval();
4141
const query = clustersApi.useGetClustersListQuery(undefined, {
4242
pollingInterval: autoRefreshInterval,
43+
skipPollingIfUnfocused: true,
4344
});
4445

4546
const dispatch = useTypedDispatch();

src/containers/Heatmap/Heatmap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const Heatmap = ({path, database}: HeatmapProps) => {
3434

3535
const {currentData, isFetching, error} = heatmapApi.useGetHeatmapTabletsInfoQuery(
3636
{path, database},
37-
{pollingInterval: autoRefreshInterval},
37+
{pollingInterval: autoRefreshInterval, skipPollingIfUnfocused: true},
3838
);
3939

4040
const loading = isFetching && currentData === undefined;

src/containers/Node/Node.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ export function Node() {
5858
currentData: node,
5959
isLoading,
6060
error,
61-
} = nodeApi.useGetNodeInfoQuery(params, {pollingInterval: autoRefreshInterval});
61+
} = nodeApi.useGetNodeInfoQuery(params, {
62+
pollingInterval: autoRefreshInterval,
63+
skipPollingIfUnfocused: true,
64+
});
6265

6366
const capabilitiesLoaded = useCapabilitiesLoaded();
6467
const isDiskPagesAvailable = useDiskPagesAvailable();

src/containers/Node/NodeStructure/NodeStructure.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function NodeStructure({nodeId, className}: NodeStructureProps) {
3131
const [autoRefreshInterval] = useAutoRefreshInterval();
3232
const {currentData, isFetching, error} = nodeApi.useGetNodeStructureQuery(
3333
{nodeId},
34-
{pollingInterval: autoRefreshInterval},
34+
{pollingInterval: autoRefreshInterval, skipPollingIfUnfocused: true},
3535
);
3636

3737
const loadingStructure = isFetching && currentData === undefined;

src/containers/Nodes/Nodes.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ function GroupedNodesComponent({
235235
},
236236
{
237237
pollingInterval: autoRefreshInterval,
238+
skipPollingIfUnfocused: true,
238239
},
239240
);
240241

src/containers/Operations/Operations.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export function Operations({database}: OperationsProps) {
2929
{database, kind, page_size: pageSize, page_token: pageToken},
3030
{
3131
pollingInterval: autoRefreshInterval,
32+
skipPollingIfUnfocused: true,
3233
},
3334
);
3435

src/containers/PDiskPage/PDiskPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export function PDiskPage() {
8383
const params = pDiskParamsDefined ? {nodeId, pDiskId} : skipToken;
8484
const pdiskDataQuery = pDiskApi.useGetPdiskInfoQuery(params, {
8585
pollingInterval: autoRefreshInterval,
86+
skipPollingIfUnfocused: true,
8687
});
8788
const pDiskLoading = pdiskDataQuery.isFetching && pdiskDataQuery.currentData === undefined;
8889
const pDiskData = pdiskDataQuery.currentData;

src/containers/Storage/PaginatedStorageGroups.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ function GroupedStorageGroupsComponent({
129129
},
130130
{
131131
pollingInterval: autoRefreshInterval,
132+
skipPollingIfUnfocused: true,
132133
},
133134
);
134135

0 commit comments

Comments
 (0)