Skip to content

Commit fd31526

Browse files
committed
fix(mothership): skip retries on 404 in useLogDetail for instant self-heal
1 parent d92be79 commit fd31526

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

apps/sim/hooks/queries/logs.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
useQuery,
88
useQueryClient,
99
} from '@tanstack/react-query'
10+
import { isApiClientError } from '@/lib/api/client/errors'
1011
import { requestJson } from '@/lib/api/client/request'
1112
import {
1213
cancelWorkflowExecutionContract,
@@ -194,6 +195,8 @@ export function useLogDetail(logId: string | undefined, options?: UseLogDetailOp
194195
enabled: Boolean(logId) && (options?.enabled ?? true),
195196
refetchInterval: options?.refetchInterval ?? false,
196197
staleTime: 30 * 1000,
198+
retry: (failureCount, err) =>
199+
!(isApiClientError(err) && err.status === 404) && failureCount < 3,
197200
})
198201
}
199202

0 commit comments

Comments
 (0)