From f04b161411eb8071189bd49f77145511e8d83e45 Mon Sep 17 00:00:00 2001 From: = <1936278+evalstate@users.noreply.github.com> Date: Thu, 5 Dec 2024 08:11:35 +0000 Subject: [PATCH] Allow setting timeout via "timeout" URL parameter --- client/src/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 0ee234b..2c84377 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -59,6 +59,7 @@ const DEFAULT_REQUEST_TIMEOUT_MSEC = 10000; const params = new URLSearchParams(window.location.search); const PROXY_PORT = params.get("proxyPort") ?? "3000"; +const REQUEST_TIMEOUT = parseInt(params.get("timeout") ?? "") || DEFAULT_REQUEST_TIMEOUT_MSEC; const PROXY_SERVER_URL = `http://localhost:${PROXY_PORT}`; const App = () => { @@ -243,7 +244,7 @@ const App = () => { const abortController = new AbortController(); const timeoutId = setTimeout(() => { abortController.abort("Request timed out"); - }, DEFAULT_REQUEST_TIMEOUT_MSEC); + }, REQUEST_TIMEOUT); let response; try {