Continue connection loop with back-off if connecting fails >5 times.
This commit is contained in:
parent
0a588fac1c
commit
fe3b917564
@ -245,7 +245,12 @@ class VoiceClient:
|
|||||||
self._connected.clear()
|
self._connected.clear()
|
||||||
yield from asyncio.sleep(retry, loop=self.loop)
|
yield from asyncio.sleep(retry, loop=self.loop)
|
||||||
yield from self.terminate_handshake()
|
yield from self.terminate_handshake()
|
||||||
|
try:
|
||||||
yield from self.connect(reconnect=True)
|
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
|
@asyncio.coroutine
|
||||||
def disconnect(self, *, force=False):
|
def disconnect(self, *, force=False):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user