mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Make sure the invoice migration loop can be interrupted
This commit is contained in:
parent
39b5462809
commit
f64f86fbb6
1 changed files with 1 additions and 1 deletions
|
@ -49,7 +49,7 @@ namespace BTCPayServer.HostedServices
|
|||
var totalCount = await _invoiceRepository.GetInvoicesTotal(invoiceQuery);
|
||||
const int PAGE_SIZE = 1000;
|
||||
var totalPages = Math.Ceiling(totalCount * 1.0m / PAGE_SIZE);
|
||||
for (int i = startFromPage; i < totalPages; i++)
|
||||
for (int i = startFromPage; i < totalPages && !CancellationToken.IsCancellationRequested; i++)
|
||||
{
|
||||
invoiceQuery.Skip = i * PAGE_SIZE;
|
||||
invoiceQuery.Take = PAGE_SIZE;
|
||||
|
|
Loading…
Add table
Reference in a new issue