Browse Source

Fix gateway deadlock (#2600)

Co-authored-by: Quin Lynch <lynchquin@gmail.com>
pull/2604/head
Casmir GitHub 2 years ago
parent
commit
0c27395efd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      src/Discord.Net.WebSocket/ConnectionManager.cs

+ 9
- 8
src/Discord.Net.WebSocket/ConnectionManager.cs View File

@@ -78,14 +78,15 @@ namespace Discord
nextReconnectDelay = 1000; //Reset delay
await _connectionPromise.Task.ConfigureAwait(false);
}
catch (OperationCanceledException ex)
{
// Added back for log out / stop to client. The connection promise would cancel and it would be logged as an error, shouldn't be the case.
// ref #2026

Cancel(); //In case this exception didn't come from another Error call
await DisconnectAsync(ex, !reconnectCancelToken.IsCancellationRequested).ConfigureAwait(false);
}
// remove for testing.
//catch (OperationCanceledException ex)
//{
// // Added back for log out / stop to client. The connection promise would cancel and it would be logged as an error, shouldn't be the case.
// // ref #2026

// Cancel(); //In case this exception didn't come from another Error call
// await DisconnectAsync(ex, !reconnectCancelToken.IsCancellationRequested).ConfigureAwait(false);
//}
catch (Exception ex)
{
Error(ex); //In case this exception didn't come from another Error call


Loading…
Cancel
Save