aboutsummaryrefslogtreecommitdiff
path: root/discord/voice_client.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-07-25 20:00:00 -0400
committerRapptz <[email protected]>2017-07-25 20:00:00 -0400
commitfe3b917564b5a9b5afe338fd594893d4c7c05f80 (patch)
tree94d4f693606b236ecd892b8e26de4c2b0040e571 /discord/voice_client.py
parentallow trailing null bytes in uploaded jpegs (diff)
downloaddiscord.py-fe3b917564b5a9b5afe338fd594893d4c7c05f80.tar.xz
discord.py-fe3b917564b5a9b5afe338fd594893d4c7c05f80.zip
Continue connection loop with back-off if connecting fails >5 times.
Diffstat (limited to 'discord/voice_client.py')
-rw-r--r--discord/voice_client.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/voice_client.py b/discord/voice_client.py
index 796eabc9..fe89d62a 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -245,7 +245,12 @@ class VoiceClient:
self._connected.clear()
yield from asyncio.sleep(retry, loop=self.loop)
yield from self.terminate_handshake()
- yield from self.connect(reconnect=True)
+ try:
+ yield from self.connect(reconnect=True)
+ except asyncio.TimeoutError:
+ # at this point we've retried 5 times... let's continue the loop.
+ log.warning('Could not connect to voice... Retrying...')
+ continue
@asyncio.coroutine
def disconnect(self, *, force=False):