Skip to content

Commit 654a9e6

Browse files
authored
Increase getDocument timeout to 20s to prevent failing while the API is normalizing documents (#264)
1 parent 80d45c3 commit 654a9e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/lib/api.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,12 @@ export const getDocument = cache(
559559
);
560560
return cacheResponse(response, immutableCacheTtl_7days);
561561
},
562+
{
563+
// Temporarily allow for a longer timeout than the default 10s
564+
// because GitBook's API currently re-normalizes all documents
565+
// and it can take more than 10s...
566+
timeout: 20 * 1000,
567+
},
562568
);
563569

564570
/**

0 commit comments

Comments
 (0)