reduce payout processor logs

This commit is contained in:
Kukks 2022-04-28 14:43:01 +02:00
parent 382fe5cd47
commit e60e8dc9ba
No known key found for this signature in database
GPG Key ID: 8E5530D9D1C93097

View File

@ -46,25 +46,21 @@ public abstract class BaseAutomatedPayoutProcessor<T> : BaseAsyncService where T
private async Task Act() private async Task Act()
{ {
Logs.PayServer.LogInformation($"Starting to process");
var store = await _storeRepository.FindStore(_PayoutProcesserSettings.StoreId); var store = await _storeRepository.FindStore(_PayoutProcesserSettings.StoreId);
var paymentMethod = store?.GetEnabledPaymentMethods(_btcPayNetworkProvider)?.FirstOrDefault( var paymentMethod = store?.GetEnabledPaymentMethods(_btcPayNetworkProvider)?.FirstOrDefault(
method => method =>
method.PaymentId == PaymentMethodId); method.PaymentId == PaymentMethodId);
var blob = GetBlob(_PayoutProcesserSettings);
if (paymentMethod is not null) if (paymentMethod is not null)
{ {
var payouts = await GetRelevantPayouts(); var payouts = await GetRelevantPayouts();
Logs.PayServer.LogInformation($"{payouts.Length} found to process"); if (payouts.Length > 0)
await Process(paymentMethod, payouts); {
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); await Task.Delay(blob.Interval, CancellationToken);
} }