Skip to content

Commit

Permalink
Retain session_id for attempts to resume the gateway session
Browse files Browse the repository at this point in the history
  • Loading branch information
SinisterRectus committed Nov 21, 2019
1 parent 4eefaca commit 36fab5f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions libs/client/Shard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ local null = json.null
local format = string.format
local sleep = timer.sleep
local setInterval, clearInterval = timer.setInterval, timer.clearInterval
local concat = table.concat
local wrap = coroutine.wrap

local ID_DELAY = constants.ID_DELAY
Expand Down Expand Up @@ -122,9 +121,7 @@ function Shard:handlePayload(payload)

elseif op == INVALID_SESSION then

local session_id = self._session_id
self._session_id = nil
if payload.d and session_id then
if payload.d and self._session_id then
self:info('Session invalidated, resuming...')
self:resume()
else
Expand Down

0 comments on commit 36fab5f

Please sign in to comment.