Refetch after a long idle in case of a new version.

This commit is contained in:
Enrico Ros
2024-10-23 22:50:54 -07:00
parent 03417c5186
commit 57ca1270e6
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -19,6 +19,7 @@ export const Release = {
// Future compatibility
Features: {
// ...
BACKEND_REVALIDATE_INTERVAL: 6 * 60 * 60 * 1000, // 6 hours
},
// this is here to trigger revalidation of data, e.g. models refresh
@@ -83,7 +83,8 @@ export function ProviderBackendCapabilities(props: { children: React.ReactNode }
// fetch capabilities
const { data } = apiQuery.backend.listCapabilities.useQuery(undefined, {
staleTime: 1000 * 60 * 60 * 24, // 1 day
staleTime: Release.Features.BACKEND_REVALIDATE_INTERVAL,
refetchOnWindowFocus: true, // refetch after a long idle
});