diff options
| author | Zeyla Hellyer <[email protected]> | 2017-10-09 12:37:40 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-10-09 12:37:40 -0700 |
| commit | c98cae4e838147eaa077bbc68ffebf8834ff7b6b (patch) | |
| tree | 81230c8c5273a827d67c60e7f07480fecb50d315 /src | |
| parent | Make the client threadpool user-customizable (diff) | |
| download | serenity-c98cae4e838147eaa077bbc68ffebf8834ff7b6b.tar.xz serenity-c98cae4e838147eaa077bbc68ffebf8834ff7b6b.zip | |
Reset shard heartbeat state on resume
When a resume is received, the heartbeat state would not be reset.
This state includes:
- whether the last heartbeat was acknowledged
- when the last heartbeat was sent
- when the last heartbeat acknowledgement was received
This resulted in the bot re-IDENTIFYing after a Resumed event was
received. To fix this issue, reset them when a Resumed event is
received.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gateway/shard.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs index 9304e2f..fbe1572 100644 --- a/src/gateway/shard.rs +++ b/src/gateway/shard.rs @@ -354,6 +354,8 @@ impl Shard { info!("[Shard {:?}] Resumed", self.shard_info); self.stage = ConnectionStage::Connected; + self.last_heartbeat_acknowledged = true; + self.heartbeat_instants = (Some(Instant::now()), None); }, #[cfg_attr(rustfmt, rustfmt_skip)] ref _other => { |