Skip to content

Commit

Permalink
Return instantly when requesting restart.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakelezz authored and arqunis committed Apr 26, 2020
1 parent de6536d commit 0959f15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/client/bridge/gateway/shard_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand All @@ -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,
)
Expand Down
3 changes: 1 addition & 2 deletions src/client/bridge/gateway/shard_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ impl<H: EventHandler + Send + Sync + 'static,

match action {
Some(ShardAction::Reconnect(ReconnectType::Reidentify)) => {
let _ = self.request_restart();
continue;
return self.request_restart();
},
Some(other) => {
let _ = self.action(&other);
Expand Down
4 changes: 2 additions & 2 deletions src/gateway/shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ impl Shard {

false
} else {
trace!("[Shard {:?}] Heartbeated", self.shard_info);
trace!("[Shard {:?}] Heartbeat", self.shard_info);

true
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0959f15

Please sign in to comment.