Skip to content

Commit f04b161

Browse files
committed
Allow setting timeout via "timeout" URL parameter
1 parent bd6a636 commit f04b161

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

client/src/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const DEFAULT_REQUEST_TIMEOUT_MSEC = 10000;
5959

6060
const params = new URLSearchParams(window.location.search);
6161
const PROXY_PORT = params.get("proxyPort") ?? "3000";
62+
const REQUEST_TIMEOUT = parseInt(params.get("timeout") ?? "") || DEFAULT_REQUEST_TIMEOUT_MSEC;
6263
const PROXY_SERVER_URL = `http://localhost:${PROXY_PORT}`;
6364

6465
const App = () => {
@@ -243,7 +244,7 @@ const App = () => {
243244
const abortController = new AbortController();
244245
const timeoutId = setTimeout(() => {
245246
abortController.abort("Request timed out");
246-
}, DEFAULT_REQUEST_TIMEOUT_MSEC);
247+
}, REQUEST_TIMEOUT);
247248

248249
let response;
249250
try {

0 commit comments

Comments
 (0)