From 1732606581144097e765998be2fa587645dfe9db Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 22 Dec 2022 20:32:24 +0900 Subject: [PATCH] Automated payout processors shouldn't spam logs on shutdown (Fix #4193) --- BTCPayServer/HostedServices/BaseAsyncService.cs | 5 ++++- .../PayoutProcessors/BaseAutomatedPayoutProcessor.cs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/HostedServices/BaseAsyncService.cs b/BTCPayServer/HostedServices/BaseAsyncService.cs index 05f6fab30..8fd4b91eb 100644 --- a/BTCPayServer/HostedServices/BaseAsyncService.cs +++ b/BTCPayServer/HostedServices/BaseAsyncService.cs @@ -14,6 +14,8 @@ namespace BTCPayServer.HostedServices protected Task[] _Tasks; public readonly Logs Logs; + public bool NoLogsOnExit { get; set; } + protected BaseAsyncService(Logs logs) { Logs = logs; @@ -77,7 +79,8 @@ namespace BTCPayServer.HostedServices if (_Tasks != null) await Task.WhenAll(_Tasks); } - Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited..."); + if (!NoLogsOnExit) + Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited..."); } } } diff --git a/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs b/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs index b2cf8a116..ff15870ee 100644 --- a/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs +++ b/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs @@ -40,6 +40,7 @@ public abstract class BaseAutomatedPayoutProcessor : BaseAsyncService where T _applicationDbContextFactory = applicationDbContextFactory; _pullPaymentHostedService = pullPaymentHostedService; _btcPayNetworkProvider = btcPayNetworkProvider; + this.NoLogsOnExit = true; } internal override Task[] InitializeTasks()