mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Refetch after a long idle in case of a new version.
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user