Browse Source

Disconnecting block fix

pull/1199/head
ComputerMaster1st 7 years ago
parent
commit
540345279a
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 5
- 0
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -251,7 +251,12 @@ namespace Discord.WebSocket
await heartbeatTask.ConfigureAwait(false); await heartbeatTask.ConfigureAwait(false);
_heartbeatTask = null; _heartbeatTask = null;


<<<<<<< HEAD
while (_heartbeatTimes.TryDequeue(out _)) { } while (_heartbeatTimes.TryDequeue(out _)) { }
=======
// Check if hearbeatTimes is not empty before dequeuing. TryDequeue can cause blocking.
if (!_heartbeatTimes.IsEmpty) while (_heartbeatTimes.TryDequeue(out long time)) { }
>>>>>>> Disconnecting block fix
_lastMessageTime = 0; _lastMessageTime = 0;


await _gatewayLogger.DebugAsync("Waiting for guild downloader").ConfigureAwait(false); await _gatewayLogger.DebugAsync("Waiting for guild downloader").ConfigureAwait(false);


Loading…
Cancel
Save