1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 05:45:22 +02:00

fix(version): reduce github requests [EE-7017] (#11678)

This commit is contained in:
Ali 2024-05-02 14:08:44 +12:00 committed by GitHub
parent eb5b9ef069
commit af4e362c5c
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() { 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,
});
} }