aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-03-21 03:52:24 -0400
committerRapptz <[email protected]>2017-03-21 03:52:24 -0400
commitfd62c8a4f1cc6859d860ebd89d3da5c3e4caebf7 (patch)
tree5a8a63d826b753a22eca668b51209868356f62e6
parentCheck if we're closed before attempting to do a reconnect. (diff)
downloaddiscord.py-fd62c8a4f1cc6859d860ebd89d3da5c3e4caebf7.tar.xz
discord.py-fd62c8a4f1cc6859d860ebd89d3da5c3e4caebf7.zip
Aggregate shard closing futures instead of doing them sequentially.
-rw-r--r--discord/shard.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/discord/shard.py b/discord/shard.py
index 8fad51e9..970f151d 100644
--- a/discord/shard.py
+++ b/discord/shard.py
@@ -236,9 +236,8 @@ class AutoShardedClient(Client):
self._closed.set()
- for shard in self.shards.values():
- yield from shard.ws.close()
-
+ to_close = [shard.ws.close() for shard in self.shards.values()]
+ yield from asyncio.wait(to_close, loop=self.loop)
yield from self.http.close()
@asyncio.coroutine