Skip to content

Commit 6a61f32

Browse files
committed
next: changed how fetch queries retries work
1 parent 42f8378 commit 6a61f32

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Exceptionless.Web/ClientApp/src/lib/features/status/api.svelte.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export function getHealthQuery() {
3434
return response.data! as string;
3535
},
3636
queryKey: queryKeys.health,
37-
retry: false,
37+
retry: true,
38+
retryDelay: 30 * 1000,
3839
staleTime: 30 * 1000
3940
}));
4041
}

src/Exceptionless.Web/ClientApp/src/routes/+layout.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
setRequestOptions({
2828
errorCallback: (response) => {
2929
throw response.problem ?? response;
30-
}
30+
},
31+
timeout: 5000
3132
});
3233
setAccessTokenFunc(() => accessToken.current);
3334
@@ -43,7 +44,7 @@
4344
throw error(404, 'Not found');
4445
}
4546
46-
if ((status === 0 || status === 503) && !ctx.options.expectedStatusCodes?.includes(status)) {
47+
if (([0, 408].includes(status) || status >= 500) && !ctx.options.expectedStatusCodes?.includes(status)) {
4748
const url = page.url;
4849
if (url.pathname.startsWith('/next/status')) {
4950
return;
@@ -71,7 +72,7 @@
7172
}
7273
7374
if (error instanceof ProblemDetails) {
74-
return !error.status || error.status >= 500;
75+
return !!error.status && error.status < 500;
7576
}
7677
7778
return true;

0 commit comments

Comments
 (0)