mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Fix some exceptions raised if port is already used
This commit is contained in:
parent
3cce7b8b35
commit
0bd02a9272
3 changed files with 6 additions and 0 deletions
|
@ -34,6 +34,8 @@ namespace BTCPayServer.HostedServices
|
|||
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
if (_Stop == null)
|
||||
return Task.CompletedTask;
|
||||
_Stop.Cancel();
|
||||
try
|
||||
{
|
||||
|
|
|
@ -59,6 +59,8 @@ namespace BTCPayServer.HostedServices
|
|||
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
if (_Cts == null)
|
||||
return Task.CompletedTask;
|
||||
_Cts.Cancel();
|
||||
return Task.WhenAll(_Tasks);
|
||||
}
|
||||
|
|
|
@ -333,6 +333,8 @@ namespace BTCPayServer.HostedServices
|
|||
|
||||
public Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
if (_Cts == null)
|
||||
return Task.CompletedTask;
|
||||
leases.Dispose();
|
||||
_Cts.Cancel();
|
||||
var waitingPendingInvoices = _WaitingInvoices ?? Task.CompletedTask;
|
||||
|
|
Loading…
Add table
Reference in a new issue