Skip to content

Commit

Permalink
fix: #1707 refech interval app pings (#2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw authored Aug 4, 2024
1 parent 3de04bd commit fbc099d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/components/Dashboard/Tiles/Apps/AppPing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,19 @@ const usePing = (app: AppType) => {
configName: name ?? '',
},
{
retry: false,
retry: true,
enabled: isActive,
refetchOnWindowFocus: false,
refetchInterval: 1000 * 60,
retryDelay(failureCount, error) {
// TODO: Add logic to retry on timeout
return 3000;
console.error(`Unable to retry app ping for app '${app.name}' (${app.id})`, error);
if (failureCount > 3) {
return 60 * 1000;
}
return 3 * 1000;
},
// 5 minutes of cache
cacheTime: 1000 * 60 * 5,
staleTime: 1000 * 60 * 5,
cacheTime: 1000 * 60,
retryOnMount: true,

select: (data) => {
const isOk = isStatusOk(app, data.status);
if (isOk)
Expand Down

0 comments on commit fbc099d

Please sign in to comment.