From 4f1b4131cb14db51593b18294fe52d0bef518aff Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 21 Oct 2019 14:03:55 +0900 Subject: [PATCH] Add more logs on hosted service exit --- BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs | 5 +++-- BTCPayServer/Payments/Lightning/LightningListener.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs b/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs index c1efc9d47..f5c936301 100644 --- a/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs +++ b/BTCPayServer/Payments/Bitcoin/NBXplorerListener.cs @@ -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..."); } } } diff --git a/BTCPayServer/Payments/Lightning/LightningListener.cs b/BTCPayServer/Payments/Lightning/LightningListener.cs index 57101a677..dfc56e5d8 100644 --- a/BTCPayServer/Payments/Lightning/LightningListener.cs +++ b/BTCPayServer/Payments/Lightning/LightningListener.cs @@ -195,7 +195,7 @@ namespace BTCPayServer.Payments.Lightning { } - Logs.PayServer.LogInformation("Lightning listened stopped"); + Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited..."); } }