Catch operation cancelled exception on the BackgroundJobScheduler

This commit is contained in:
nicolas.dorier 2019-03-29 18:09:54 +09:00
parent 0f2e3ef957
commit 978b7d930e

View File

@ -45,7 +45,14 @@ namespace BTCPayServer.HostedServices
{
}
await BackgroundJobClient.WaitAllRunning(cancellationToken);
try
{
await BackgroundJobClient.WaitAllRunning(cancellationToken);
}
catch (OperationCanceledException)
{
}
}
}
@ -91,6 +98,8 @@ namespace BTCPayServer.HostedServices
Task[] processing = null;
lock (_Processing)
{
if (_Processing.Count == 0)
return;
processing = _Processing.ToArray();
}