mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Patch the watchdog shutdown crash
This commit is contained in:
@@ -147,6 +147,11 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// </summary>
|
||||
bool running;
|
||||
|
||||
/// <summary>
|
||||
/// If the <see cref="WatchdogBase"/> has been <see cref="Dispose"/>d.
|
||||
/// </summary>
|
||||
bool disposed;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WatchdogBase"/> <see langword="class"/>.
|
||||
/// </summary>
|
||||
@@ -216,6 +221,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
restartRegistration.Dispose();
|
||||
DisposeAndNullControllers();
|
||||
monitorCts?.Dispose();
|
||||
disposed = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -672,7 +678,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
false,
|
||||
cancellationToken);
|
||||
|
||||
if (monitorState.NextAction != MonitorAction.Exit)
|
||||
if (disposed)
|
||||
monitorState.NextAction = MonitorAction.Exit;
|
||||
else if (monitorState.NextAction != MonitorAction.Exit)
|
||||
monitorState = await MonitorRestart(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
await chatTask.ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user