Double read timeout to fix 'The read operation timed out'

5 seconds is the default
This commit is contained in:
Hugo van Kemenade 2024-01-22 09:23:41 +02:00
parent b4c8dc7282
commit 370ff77f21

View file

@ -894,6 +894,7 @@ class _Request:
username = "" if username is None else f"?username={username}" username = "" if username is None else f"?username={username}"
(host_name, host_subdir) = self.network.ws_server (host_name, host_subdir) = self.network.ws_server
timeout = httpx.Timeout(5, read=10)
if self.network.is_proxy_enabled(): if self.network.is_proxy_enabled():
client = httpx.Client( client = httpx.Client(
@ -901,12 +902,14 @@ class _Request:
base_url=f"https://{host_name}", base_url=f"https://{host_name}",
headers=HEADERS, headers=HEADERS,
proxies=self.network.proxy, proxies=self.network.proxy,
timeout=timeout,
) )
else: else:
client = httpx.Client( client = httpx.Client(
verify=SSL_CONTEXT, verify=SSL_CONTEXT,
base_url=f"https://{host_name}", base_url=f"https://{host_name}",
headers=HEADERS, headers=HEADERS,
timeout=timeout,
) )
try: try: