diff options
| author | Rapptz <[email protected]> | 2017-04-22 21:36:29 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-04-22 21:36:29 -0400 |
| commit | a76909e182f0779150df1296805596261e530fc6 (patch) | |
| tree | eb057084cbe400ed57ad8a75499e0f463686c270 | |
| parent | Add timeouts for websocket initial connections. (diff) | |
| download | discord.py-a76909e182f0779150df1296805596261e530fc6.tar.xz discord.py-a76909e182f0779150df1296805596261e530fc6.zip | |
Fix RESUME handling and make sure to wait 5 seconds before attempting.
| -rw-r--r-- | discord/gateway.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/discord/gateway.py b/discord/gateway.py index d388d12a..8b3833b8 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -347,12 +347,14 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol): return if op == self.INVALIDATE_SESSION: - state.sequence = None - state.session_id = None if data == True: + yield from asyncio.sleep(5.0, loop=self.loop) yield from self.close() raise ResumeWebSocket() + state.sequence = None + state.session_id = None + yield from self.identify() return |