mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-19 05:33:31 +01:00
Make sure btcpay does not wait all the invoces to be cleaned to start
This commit is contained in:
parent
af0eb831a2
commit
9339c7dff2
@ -261,6 +261,7 @@ namespace BTCPayServer.HostedServices
|
||||
|
||||
private async Task WaitPendingInvoices()
|
||||
{
|
||||
await new SynchronizationContextRemover();
|
||||
await Task.WhenAll((await _InvoiceRepository.GetPendingInvoices())
|
||||
.Select(id => Wait(id)).ToArray());
|
||||
_WaitingInvoices = null;
|
||||
@ -268,8 +269,8 @@ namespace BTCPayServer.HostedServices
|
||||
|
||||
async Task StartLoop(CancellationToken cancellation)
|
||||
{
|
||||
await new SynchronizationContextRemover();
|
||||
Logs.PayServer.LogInformation("Start watching invoices");
|
||||
await Task.Delay(1).ConfigureAwait(false); // Small hack so that the caller does not block on GetConsumingEnumerable
|
||||
try
|
||||
{
|
||||
foreach (var invoiceId in _WatchRequests.GetConsumingEnumerable(cancellation))
|
||||
|
Loading…
Reference in New Issue
Block a user