Don't kill the gateway session when trying to resume

Sending a close code of 1000 or 1001 invalidates gateway sessions.
Instead, we use close code 1005 (no error specified)
This commit is contained in:
spiral
2021-07-08 09:19:44 -04:00
parent e620e30c10
commit 889e1a8331

View File

@@ -163,7 +163,9 @@ namespace Myriad.Gateway
private async Task HandleReconnect()
{
_logger.Information("Shard {ShardId}: Received Reconnect", _info.ShardId);
await DoReconnect(WebSocketCloseStatus.NormalClosure, TimeSpan.FromSeconds(1));
// close code 1000 kills the session, so can't reconnect
// we use 1005 (no error specified) instead
await DoReconnect(WebSocketCloseStatus.Empty, TimeSpan.FromSeconds(1));
}
private Task HandleReady(ReadyEvent ready)