aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/utils/http.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/http.py b/src/utils/http.py
index 15f371fe..88edeb46 100644
--- a/src/utils/http.py
+++ b/src/utils/http.py
@@ -127,12 +127,13 @@ def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]:
data = response.body.decode("utf8")
responses[url] = Response(response.code, data, headers)
- loop = asyncio.get_event_loop()
+ loop = asyncio.new_event_loop()
awaits = []
for url in urls:
awaits.append(_request(url))
task = asyncio.gather(*awaits, return_exceptions=True)
loop.run_until_complete(task)
+ loop.close()
return responses