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

Revert "feat(app): 1s staleTime to avoid sending repeated requests" (#639)

This commit is contained in:
LP B 2025-04-14 01:12:11 +02:00 committed by GitHub
parent c331ada086
commit 7aa9f8b1c3
10 changed files with 14 additions and 4 deletions

View file

@ -83,6 +83,7 @@ export function useDeleteHelmRepositoriesMutation() {
export function useHelmRepositories(userId: number) {
return useQuery(['helmrepositories'], () => getHelmRepositories(userId), {
staleTime: 20,
...withError('Unable to retrieve Helm repositories'),
});
}

View file

@ -31,6 +31,7 @@ export function useGroup<T = EnvironmentGroup>(
return getGroup(groupId);
},
{
staleTime: 50,
select,
enabled: groupId !== undefined,
...withGlobalError('Failed loading group'),

View file

@ -27,6 +27,7 @@ export function useEnvironment<T = Environment>(
{
select,
...withError('Failed loading environment'),
staleTime: 50,
enabled: !!environmentId,
refetchInterval() {
return options?.autoRefreshRate ?? false;

View file

@ -20,7 +20,7 @@ interface Params {
export function useTagDetails<T = RepositoryTagViewModel>(
params: Params,
{
staleTime,
staleTime = 0,
select,
}: { select?: (model: RepositoryTagViewModel) => T; staleTime?: number } = {}
) {

View file

@ -19,6 +19,7 @@ export function useExperimentalSettings<T = ExperimentalFeaturesSettings>(
return useQuery(queryKeys.experimental(), getExperimentalSettings, {
select,
enabled,
staleTime: 50,
...withError('Unable to retrieve experimental settings'),
});
}

View file

@ -22,6 +22,7 @@ export function useSettings<T = Settings>(
return useQuery(queryKeys.base(), getSettings, {
select,
enabled,
staleTime: 50,
...withError('Unable to retrieve settings'),
});
}