From f5fa45be0c450bd0ee6162afadf89f353ae043a6 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Wed, 14 Jun 2017 16:42:09 -0700 Subject: 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. --- src/client/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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) => { -- cgit v1.2.3