Add override to close() method to the websocket subclass.

This makes it so that _keep_alive is stopped no matter which closing
method is called
This commit is contained in:
CraftSpider 2018-12-01 22:45:37 -05:00 committed by Rapptz
parent dd41dac680
commit 068d953b42

View File

@ -510,6 +510,12 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
log.debug('Updating our voice state to %s.', payload)
await self.send_as_json(payload)
async def close(self, code=1000, reason=''):
if self._keep_alive:
self._keep_alive.stop()
await super().close(code, reason)
async def close_connection(self, *args, **kwargs):
if self._keep_alive:
self._keep_alive.stop()