asyncio.gather -> asyncio.wait (with timeout)
This commit is contained in:
parent
469c725675
commit
c19c6c0e14
1 changed files with 1 additions and 1 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue