Automated payout processors shouldn't spam logs on shutdown (Fix #4193)

This commit is contained in:
nicolas.dorier 2022-12-22 20:32:24 +09:00
parent 68cdd2c2c8
commit 1732606581
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
2 changed files with 5 additions and 1 deletions

View File

@ -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...");
}
}
}

View File

@ -40,6 +40,7 @@ public abstract class BaseAutomatedPayoutProcessor<T> : BaseAsyncService where T
_applicationDbContextFactory = applicationDbContextFactory;
_pullPaymentHostedService = pullPaymentHostedService;
_btcPayNetworkProvider = btcPayNetworkProvider;
this.NoLogsOnExit = true;
}
internal override Task[] InitializeTasks()