potential fix for automatic reconnects

This commit is contained in:
Stanley Dimant
2022-11-03 10:26:22 +01:00
parent 5694eb7d08
commit 153fd9b1c8

View File

@@ -267,6 +267,7 @@ public partial class ApiController : IDisposable, IMareHubClient
Logger.Debug("Checked Client Health State, healthy: " + !needsRestart); Logger.Debug("Checked Client Health State, healthy: " + !needsRestart);
if (needsRestart) if (needsRestart)
{ {
ServerState = ServerState.Offline;
_ = CreateConnections(); _ = CreateConnections();
} }
} }
@@ -380,7 +381,6 @@ public partial class ApiController : IDisposable, IMareHubClient
await _mareHub.DisposeAsync().ConfigureAwait(false); await _mareHub.DisposeAsync().ConfigureAwait(false);
CurrentUploads.Clear(); CurrentUploads.Clear();
CurrentDownloads.Clear(); CurrentDownloads.Clear();
_uploadCancellationTokenSource?.Cancel();
Disconnected?.Invoke(); Disconnected?.Invoke();
_mareHub = null; _mareHub = null;
} }