Skip to content

Commit 8adaa7e

Browse files
committed
fix: Flag cluster info stale time clearly
1 parent e900dc6 commit 8adaa7e

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/features/cluster/Scaling.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getClusterInfoQueryOptions } from './queries/getClusterInfoQuery';
1111
export function Scaling() {
1212
const { clusterId }: { organizationId: string; clusterId: string } = useParams({ strict: false });
1313
const { data: cluster, isLoading: clusterIsLoading } = useQuery(
14-
getClusterInfoQueryOptions(clusterId, 2000),
14+
getClusterInfoQueryOptions(clusterId, 2_000),
1515
);
1616
const status = cluster?.status;
1717
const clusterIsActive = useMemo(() => {

src/features/cluster/StartingUp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function StartingUp() {
1818
const router = useRouter();
1919
const { clusterId }: { organizationId: string; clusterId: string } = useParams({ strict: false });
2020
const { data: cluster, isLoading: clusterIsLoading } = useQuery(
21-
getClusterInfoQueryOptions(clusterId, 2000),
21+
getClusterInfoQueryOptions(clusterId, 2_000),
2222
);
2323

2424
const status = cluster?.status;

src/features/cluster/queries/getClusterInfoQuery.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ export function getClusterInfoQueryOptions(clusterId?: string | false, refetch?:
1212
queryKey: [clusterId],
1313
queryFn: () => getClusterInfo(clusterId as string),
1414
retry: false,
15+
staleTime: 1_900,
1516
enabled: !!clusterId,
1617
refetchInterval: refetch
1718
? refetch === true
18-
? 10000
19+
? 10_000
1920
: refetch
2021
: undefined,
2122
});

src/features/clusters/components/ClusterProgress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function ClusterProgress({ cluster, forceProgressBarVisible }: {
1919
const [showProgress, setShowProgress] = useState(forceProgressBarVisible || false);
2020

2121
const { data: clusterById } = useQuery(
22-
getClusterInfoQueryOptions(showProgress && cluster.id, 2000),
22+
getClusterInfoQueryOptions(showProgress && cluster.id, 2_000),
2323
);
2424

2525
useEffect(function showProgressIfPendingOrUpdating() {

0 commit comments

Comments
 (0)