1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00

fix(version): reduce github requests [EE-7017] (#11679)
Some checks failed
/ triage (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
ci / build_images (map[arch:arm platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:arm64 platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:ppc64le platform:linux version:]) (push) Has been cancelled
ci / build_images (map[arch:s390x platform:linux version:]) (push) Has been cancelled
Lint / Run linters (push) Has been cancelled
Test / test-client (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:linux]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Has been cancelled
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Has been cancelled
Test / test-server (map[arch:arm64 platform:linux]) (push) Has been cancelled
ci / build_manifests (push) Has been cancelled

This commit is contained in:
Ali 2024-04-26 08:46:13 +12:00 committed by GitHub
parent 2856d0ed64
commit 0be1888f11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,5 +36,9 @@ export async function getSystemVersion() {
}
export function useSystemVersion() {
return useQuery(queryKey, () => getSystemVersion());
return useQuery(queryKey, () => getSystemVersion(), {
// 24 hour stale time to reduce the number of requests to avoid github api rate limits
// a hard refresh of the browser will still trigger a new request
staleTime: 24 * 60 * 60 * 1000,
});
}