mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-03-05 03:02:49 +00:00
Close websocket when reconnecting websocket during polling
Close #10409
This commit is contained in:
@@ -654,6 +654,7 @@ class DiscordWebSocket:
|
|||||||
self._keep_alive.stop()
|
self._keep_alive.stop()
|
||||||
self._keep_alive = None
|
self._keep_alive = None
|
||||||
|
|
||||||
|
await self.socket.close(code=4000)
|
||||||
if isinstance(e, asyncio.TimeoutError):
|
if isinstance(e, asyncio.TimeoutError):
|
||||||
_log.debug('Timed out receiving packet. Attempting a reconnect.')
|
_log.debug('Timed out receiving packet. Attempting a reconnect.')
|
||||||
raise ReconnectWebSocket(self.shard_id) from None
|
raise ReconnectWebSocket(self.shard_id) from None
|
||||||
|
|||||||
Reference in New Issue
Block a user