fix: #1707 refech interval app pings (#2097)

This commit is contained in:
Manuel
2024-08-04 17:47:31 +02:00
committed by GitHub
parent 3de04bdb22
commit fbc099d198

View File

@@ -108,18 +108,19 @@ const usePing = (app: AppType) => {
configName: name ?? '', configName: name ?? '',
}, },
{ {
retry: false, retry: true,
enabled: isActive, enabled: isActive,
refetchOnWindowFocus: false, refetchOnWindowFocus: false,
refetchInterval: 1000 * 60,
retryDelay(failureCount, error) { retryDelay(failureCount, error) {
// TODO: Add logic to retry on timeout console.error(`Unable to retry app ping for app '${app.name}' (${app.id})`, error);
return 3000; if (failureCount > 3) {
return 60 * 1000;
}
return 3 * 1000;
}, },
// 5 minutes of cache cacheTime: 1000 * 60,
cacheTime: 1000 * 60 * 5,
staleTime: 1000 * 60 * 5,
retryOnMount: true, retryOnMount: true,
select: (data) => { select: (data) => {
const isOk = isStatusOk(app, data.status); const isOk = isStatusOk(app, data.status);
if (isOk) if (isOk)