Add more logs on hosted service exit

This commit is contained in:
nicolas.dorier
2019-10-21 14:03:55 +09:00
parent ccb45e3a99
commit 4f1b4131cb
2 changed files with 4 additions and 3 deletions

View File

@@ -383,11 +383,12 @@ namespace BTCPayServer.Payments.Bitcoin
_Aggregator.Publish(new InvoiceEvent(invoice, 1002, InvoiceEvent.ReceivedPayment){Payment = payment});
return invoice;
}
public Task StopAsync(CancellationToken cancellationToken)
public async Task StopAsync(CancellationToken cancellationToken)
{
leases.Dispose();
_Cts.Cancel();
return Task.WhenAny(_RunningTask.Task, Task.Delay(-1, cancellationToken));
await Task.WhenAny(_RunningTask.Task, Task.Delay(-1, cancellationToken));
Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited...");
}
}
}

View File

@@ -195,7 +195,7 @@ namespace BTCPayServer.Payments.Lightning
{
}
Logs.PayServer.LogInformation("Lightning listened stopped");
Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited...");
}
}