Skip to content

Commit 713315c

Browse files
authored
fix(Cluster): autorefresh cluster data (#2307)
1 parent 478c9e8 commit 713315c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/containers/Cluster/Cluster.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import type {
2626
} from '../../types/additionalProps';
2727
import {EFlag} from '../../types/api/enums';
2828
import {cn} from '../../utils/cn';
29-
import {useTypedDispatch, useTypedSelector} from '../../utils/hooks';
29+
import {useAutoRefreshInterval, useTypedDispatch, useTypedSelector} from '../../utils/hooks';
3030
import {Nodes} from '../Nodes/Nodes';
3131
import {PaginatedStorage} from '../Storage/PaginatedStorage';
3232
import {TabletsTable} from '../Tablets/TabletsTable';
@@ -55,6 +55,8 @@ export function Cluster({
5555
const container = React.useRef<HTMLDivElement>(null);
5656
const isClusterDashboardAvailable = useClusterDashboardAvailable();
5757

58+
const [autoRefreshInterval] = useAutoRefreshInterval();
59+
5860
const dispatch = useTypedDispatch();
5961

6062
const activeTabId = useClusterTab();
@@ -76,7 +78,9 @@ export function Cluster({
7678
data: {clusterData: cluster, groupsStats} = {},
7779
isLoading: infoLoading,
7880
error,
79-
} = clusterApi.useGetClusterInfoQuery(clusterName ?? undefined);
81+
} = clusterApi.useGetClusterInfoQuery(clusterName ?? undefined, {
82+
pollingInterval: autoRefreshInterval,
83+
});
8084

8185
const clusterError = error && typeof error === 'object' ? error : undefined;
8286

0 commit comments

Comments
 (0)