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 55bc06f commit b8e2a7d
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 @@ -296,7 +296,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 @@ -310,7 +310,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 @@ -139,8 +139,7 @@ impl ShardRunner {

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 @@ -616,7 +616,7 @@ impl Shard {

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

true
}
Expand Down Expand Up @@ -799,7 +799,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 b8e2a7d

Please sign in to comment.