aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-06-14 16:42:09 -0700
committerZeyla Hellyer <[email protected]>2017-06-14 16:42:09 -0700
commitf5fa45be0c450bd0ee6162afadf89f353ae043a6 (patch)
tree8d745dda3ac4c996f3d9a3f4ed9dbfe3caaef5da /src/client
parentMake EmbedFooter icon URLs optional (diff)
downloadserenity-f5fa45be0c450bd0ee6162afadf89f353ae043a6.tar.xz
serenity-f5fa45be0c450bd0ee6162afadf89f353ae043a6.zip
Reset shard handling on reconnects
After the shard handler successfully reconnects a shard, reset the `last_ack_time` and `last_heartbeat_sent` to avoid going into an endless reconnection loop.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index 3b7a2ec..3a6b786 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -1392,6 +1392,9 @@ fn handle_shard(info: &mut MonitorInfo) {
Ok(_) => {
debug!("Successfully resumed shard");
+ last_ack_time = UTC::now().timestamp();
+ last_heartbeat_sent = UTC::now().timestamp();
+
continue;
},
Err(why) => {
@@ -1433,6 +1436,9 @@ fn handle_shard(info: &mut MonitorInfo) {
Ok(_) => {
debug!("Successfully resumed shard");
+ last_ack_time = UTC::now().timestamp();
+ last_heartbeat_sent = UTC::now().timestamp();
+
continue;
},
Err(why) => {