From 0959f15e3605a2fea1e945bd4d8ef0e8052e6d65 Mon Sep 17 00:00:00 2001 From: Lake Lezz <12222135+Lakelezz@users.noreply.github.com> Date: Sat, 25 Apr 2020 15:48:02 +0200 Subject: [PATCH] Return instantly when requesting restart. --- src/client/bridge/gateway/shard_manager.rs | 4 ++-- src/client/bridge/gateway/shard_runner.rs | 3 +-- src/gateway/shard.rs | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/client/bridge/gateway/shard_manager.rs b/src/client/bridge/gateway/shard_manager.rs index c218a278df1..86e2b1cb07a 100644 --- a/src/client/bridge/gateway/shard_manager.rs +++ b/src/client/bridge/gateway/shard_manager.rs @@ -298,7 +298,7 @@ impl ShardManager { if let Err(why) = runner.runner_tx.send(msg) { warn!( - "Failed to cleanly shutdown shard {}: {:?}", + "Failed to send shutdown shard {}: {:?}", shard_id, why, ); @@ -312,7 +312,7 @@ impl ShardManager { ); }, Err(why) => warn!( - "Failed to cleanly shutdown shard {}: {:?}", + "Failed to cleanly shutdown shard {} due to timeout: {:?}", shard_id, why, ) diff --git a/src/client/bridge/gateway/shard_runner.rs b/src/client/bridge/gateway/shard_runner.rs index 9814269cf2a..3dc8925e5b7 100644 --- a/src/client/bridge/gateway/shard_runner.rs +++ b/src/client/bridge/gateway/shard_runner.rs @@ -142,8 +142,7 @@ impl { - let _ = self.request_restart(); - continue; + return self.request_restart(); }, Some(other) => { let _ = self.action(&other); diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs index 832ce7c54d3..8c20e5f8ea7 100644 --- a/src/gateway/shard.rs +++ b/src/gateway/shard.rs @@ -613,7 +613,7 @@ impl Shard { false } else { - trace!("[Shard {:?}] Heartbeated", self.shard_info); + trace!("[Shard {:?}] Heartbeat", self.shard_info); true } @@ -796,7 +796,7 @@ impl Shard { } pub fn resume(&mut self) -> Result<()> { - debug!("Shard {:?}] Attempting to resume", self.shard_info); + debug!("[Shard {:?}] Attempting to resume", self.shard_info); self.client = self.initialize()?; self.stage = ConnectionStage::Resuming;