Clean cache when TimeoutError occurs.

This commit is contained in:
Rapptz 2017-04-18 20:13:34 -04:00
parent f9c2ac9d25
commit aa32c384ea

View File

@ -144,7 +144,7 @@ class VoiceClient:
try:
yield from asyncio.wait_for(self._handshake_complete.wait(), timeout=self.timeout, loop=self.loop)
except asyncio.TimeoutError as e:
yield from ws.voice_state(guild_id, None, self_mute=True)
yield from self.terminate_handshake(remove=True)
raise e
log.info('Voice handshake complete. Endpoint found %s (IP: %s)', self.endpoint, self.endpoint_ip)