From e60e8dc9ba8092a68536e14be53623f56bbcde81 Mon Sep 17 00:00:00 2001 From: Kukks Date: Thu, 28 Apr 2022 14:43:01 +0200 Subject: [PATCH] reduce payout processor logs --- .../BaseAutomatedPayoutProcessor.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs b/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs index 7a31a70ff..0e345e32d 100644 --- a/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs +++ b/BTCPayServer/PayoutProcessors/BaseAutomatedPayoutProcessor.cs @@ -46,25 +46,21 @@ public abstract class BaseAutomatedPayoutProcessor : BaseAsyncService where T private async Task Act() { - Logs.PayServer.LogInformation($"Starting to process"); var store = await _storeRepository.FindStore(_PayoutProcesserSettings.StoreId); var paymentMethod = store?.GetEnabledPaymentMethods(_btcPayNetworkProvider)?.FirstOrDefault( method => method.PaymentId == PaymentMethodId); + + var blob = GetBlob(_PayoutProcesserSettings); if (paymentMethod is not null) { var payouts = await GetRelevantPayouts(); - Logs.PayServer.LogInformation($"{payouts.Length} found to process"); - await Process(paymentMethod, payouts); + if (payouts.Length > 0) + { + Logs.PayServer.LogInformation($"{payouts.Length} found to process. Starting (and after will sleep for {blob.Interval})"); + await Process(paymentMethod, payouts); + } } - else - { - Logs.PayServer.LogInformation($"Payment method not configured."); - } - - var blob = GetBlob(_PayoutProcesserSettings); - - Logs.PayServer.LogInformation($"Sleeping for {blob.Interval}"); await Task.Delay(blob.Interval, CancellationToken); }