From c19c6c0e14078c4b759b52c94b40efdd0a974198 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 8 Jul 2019 14:50:11 +0100 Subject: [PATCH] asyncio.gather -> asyncio.wait (with timeout) --- src/utils/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/http.py b/src/utils/http.py index e6ed9b24..6086fb37 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -131,7 +131,7 @@ def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]: awaits = [] for url in urls: awaits.append(_request(url)) - task = asyncio.gather(*awaits, return_exceptions=True, loop=loop) + task = asyncio.wait(awaits, loop=loop, timeout=5) loop.run_until_complete(task) loop.close()