aboutsummaryrefslogtreecommitdiff
path: root/src/gateway/mod.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-12-16 20:49:01 -0800
committerZeyla Hellyer <[email protected]>2017-12-16 20:49:01 -0800
commite6788838556d13d4a4f19253ce297ca2f72168ee (patch)
tree72b5e315257fc609664e65eaf0c3992b19a51105 /src/gateway/mod.rs
parentAvoid an unwrap in args::parse_quotes (diff)
downloadserenity-e6788838556d13d4a4f19253ce297ca2f72168ee.tar.xz
serenity-e6788838556d13d4a4f19253ce297ca2f72168ee.zip
Fix shards attempting to re-identify on their own
Fix shards by taking away their responsibility to re-identify, instead shutting down shard runners and going through the shard queuer to restart a shard runner and its associated shard. This fixes the case where a running shard's session invalidates and re-IDENTIFYs within 5 seconds before queued shard starts, causing a cascading failure of sessions for new shards.
Diffstat (limited to 'src/gateway/mod.rs')
-rw-r--r--src/gateway/mod.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs
index 7e4e2b0..a6de656 100644
--- a/src/gateway/mod.rs
+++ b/src/gateway/mod.rs
@@ -148,9 +148,15 @@ impl ConnectionStage {
}
pub enum ShardAction {
- Autoreconnect,
Heartbeat,
Identify,
- Reconnect,
+ Reconnect(ReconnectType),
+}
+
+/// The type of reconnection that should be performed.
+pub enum ReconnectType {
+ /// Indicator that a new connection should be made by sending an IDENTIFY.
+ Reidentify,
+ /// Indicator that a new connection should be made by sending a RESUME.
Resume,
}