aboutsummaryrefslogtreecommitdiff
path: root/discord/state.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-12-21 00:01:00 -0500
committerRapptz <[email protected]>2016-12-21 00:06:19 -0500
commitbed2e90e825f9cf90fc1ecbae3f49472de05ad3c (patch)
tree655476debe560028148b63ce645aef69f2eeed4c /discord/state.py
parentVersion bump to v0.16.0. (diff)
downloaddiscord.py-bed2e90e825f9cf90fc1ecbae3f49472de05ad3c.tar.xz
discord.py-bed2e90e825f9cf90fc1ecbae3f49472de05ad3c.zip
Properly propagate loop. Fixes #420.
Diffstat (limited to 'discord/state.py')
-rw-r--r--discord/state.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/discord/state.py b/discord/state.py
index aed5a746..48a75a47 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -170,7 +170,7 @@ class ConnectionState:
# this snippet of code is basically waiting 2 seconds
# until the last GUILD_CREATE was sent
launch.set()
- yield from asyncio.sleep(2)
+ yield from asyncio.sleep(2, loop=self.loop)
servers = self._ready_state.servers
@@ -187,7 +187,7 @@ class ConnectionState:
# wait for the chunks
if chunks:
try:
- yield from asyncio.wait(chunks, timeout=len(chunks))
+ yield from asyncio.wait(chunks, timeout=len(chunks), loop=self.loop)
except asyncio.TimeoutError:
log.info('Somehow timed out waiting for chunks.')
@@ -489,7 +489,10 @@ class ConnectionState:
yield from self.chunker(server)
chunks = list(self.chunks_needed(server))
if chunks:
- yield from asyncio.wait(chunks)
+ try:
+ yield from asyncio.wait(chunks, timeout=len(chunks), loop=self.loop)
+ except asyncio.TimeoutError:
+ log.info('Somehow timed out waiting for chunks.')
if unavailable == False:
self.dispatch('server_available', server)