Stop the JobManager before the instances jesus christ what was I thinking

This commit is contained in:
Jordan Brown
2018-08-18 02:17:26 -04:00
parent 2945713386
commit 2391edabef
@@ -208,10 +208,11 @@ namespace Tgstation.Server.Host.Components
/// <inheritdoc />
public async Task StopAsync(CancellationToken cancellationToken)
{
await jobManager.StopAsync(cancellationToken).ConfigureAwait(false);
using (cancellationToken.Register(() => shutdownCancellationTokenSource.Cancel()))
await Task.WhenAll(shutdownTasks).ConfigureAwait(false);
await Task.WhenAll(instances.Select(x => x.Value.StopAsync(cancellationToken))).ConfigureAwait(false);
await jobManager.StopAsync(cancellationToken).ConfigureAwait(false);
}
}
}