Aggregate shard closing futures instead of doing them sequentially.
This commit is contained in:
parent
5461bfb475
commit
fd62c8a4f1
@ -236,9 +236,8 @@ class AutoShardedClient(Client):
|
|||||||
|
|
||||||
self._closed.set()
|
self._closed.set()
|
||||||
|
|
||||||
for shard in self.shards.values():
|
to_close = [shard.ws.close() for shard in self.shards.values()]
|
||||||
yield from shard.ws.close()
|
yield from asyncio.wait(to_close, loop=self.loop)
|
||||||
|
|
||||||
yield from self.http.close()
|
yield from self.http.close()
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user