bug: try to fix scan timeout with asyncio.wait_for.
This commit is contained in:
@@ -557,7 +557,10 @@ class MinerFactory:
|
|||||||
async with httpx.AsyncClient(
|
async with httpx.AsyncClient(
|
||||||
transport=settings.transport(verify=False)
|
transport=settings.transport(verify=False)
|
||||||
) as c:
|
) 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
|
return resp.text, resp
|
||||||
except (
|
except (
|
||||||
httpx.HTTPError,
|
httpx.HTTPError,
|
||||||
|
|||||||
Reference in New Issue
Block a user