Dispose CTS in WebHost.StopAsync (#24399)

This commit is contained in:
Kahbazi 2020-07-29 17:13:46 +04:30 committed by GitHub
parent e225057370
commit 01e05359d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -325,7 +325,8 @@ namespace Microsoft.AspNetCore.Hosting
_logger.Shutdown();
var timeoutToken = new CancellationTokenSource(Options.ShutdownTimeout).Token;
using var timeoutCTS = new CancellationTokenSource(Options.ShutdownTimeout);
var timeoutToken = timeoutCTS.Token;
if (!cancellationToken.CanBeCanceled)
{
cancellationToken = timeoutToken;