Fix chat provider race condition

Reconnection attempts could still be made if the job starts as the provider was disconnecting. Stop the reconnection timer before attempting a disconnect.
This commit is contained in:
Jordan Brown
2021-08-31 10:49:00 -04:00
parent 176035d444
commit 810d86a8a9
@@ -103,13 +103,13 @@ namespace Tgstation.Server.Host.Components.Chat.Providers
/// <inheritdoc />
public async Task Disconnect(CancellationToken cancellationToken)
{
await StopReconnectionTimer().ConfigureAwait(false);
if (Connected)
{
await DisconnectImpl(cancellationToken).ConfigureAwait(false);
Logger.LogTrace("Disconnected");
}
await StopReconnectionTimer().ConfigureAwait(false);
}
/// <inheritdoc />