Close websocket when reconnecting websocket during polling

Close #10409
This commit is contained in:
Rapptz
2026-02-25 12:08:49 -05:00
parent 7f9c3b1b40
commit 198549822e

View File

@@ -654,6 +654,7 @@ class DiscordWebSocket:
self._keep_alive.stop()
self._keep_alive = None
await self.socket.close(code=4000)
if isinstance(e, asyncio.TimeoutError):
_log.debug('Timed out receiving packet. Attempting a reconnect.')
raise ReconnectWebSocket(self.shard_id) from None