Skip to content

Commit c82cffc

Browse files
committed
feat: adjust readiness check timing and conditionally invoke on non-building state
1 parent 0e63659 commit c82cffc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/routes/isReady/+server.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { building } from '$app/environment';
12
import { json } from '@sveltejs/kit';
23

34
const GRAPHQL_API_URL = import.meta.env.VITE_GRAPHQL_ENDPOINT || 'http://localhost:3000/graphql';
@@ -23,10 +24,12 @@ let isAppReady = false;
2324

2425
async function ready() {
2526
isAppReady = await checkGraphQLAPI();
26-
setTimeout(ready, 1000);
27+
setTimeout(ready, 3000);
2728
}
2829

29-
ready();
30+
if (!building) {
31+
ready();
32+
}
3033

3134
export async function GET() {
3235
return json(

0 commit comments

Comments
 (0)