Skip to content

Commit f45714f

Browse files
committed
Improve timeout handling in fetch.js
1 parent db3a175 commit f45714f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/api/fetch.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ async function fetchWithProxy(url, options = {}, fetchOptions = {}) {
3333
}
3434

3535
// Handle timeout
36-
const timeout = fetchOptions.timeout;
36+
let timeout = fetchOptions.timeout;
37+
if (timeout === 0) {
38+
// set timeout to a large value to prevent default timeout
39+
timeout = 24 * 60 * 60 * 1000;
40+
}
3741
let timeoutId = null;
3842
if (timeout) {
3943
const controller = new AbortController();

0 commit comments

Comments
 (0)