Fix spurious crash at shutdown

This commit is contained in:
nicolas.dorier 2022-07-04 13:17:36 +09:00
parent 2c3b8d8925
commit f30ddbf175
No known key found for this signature in database
GPG key ID: 6618763EF09186FE

View file

@ -106,9 +106,11 @@ namespace BTCPayServer
{ {
} }
} }
cancellationToken.ThrowIfCancellationRequested();
lock (_Queues) lock (_Queues)
{ {
if (_Queues.Count is 0)
return;
cancellationToken.ThrowIfCancellationRequested();
Cleanup(); Cleanup();
} }
} }