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:
parent
dd41dac680
commit
068d953b42
@ -510,6 +510,12 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
|||||||
log.debug('Updating our voice state to %s.', payload)
|
log.debug('Updating our voice state to %s.', payload)
|
||||||
await self.send_as_json(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):
|
async def close_connection(self, *args, **kwargs):
|
||||||
if self._keep_alive:
|
if self._keep_alive:
|
||||||
self._keep_alive.stop()
|
self._keep_alive.stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user