bug: try to fix scan timeout with asyncio.wait_for.

This commit is contained in:
Upstream Data
2024-05-13 08:28:12 -06:00
parent 46c56134f7
commit 54f0292712

View File

@@ -557,7 +557,10 @@ class MinerFactory:
async with httpx.AsyncClient(
transport=settings.transport(verify=False)
) as c:
resp = await c.get(url, follow_redirects=True)
resp = await asyncio.wait_for(
c.get(url, follow_redirects=True),
settings.get("api_function_timeout", 5),
)
return resp.text, resp
except (
httpx.HTTPError,