mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Improve logs of the invoice text search import
This commit is contained in:
parent
f027d36db8
commit
eedf189d44
1 changed files with 3 additions and 2 deletions
|
@ -61,10 +61,10 @@ namespace BTCPayServer.HostedServices
|
|||
var totalCount = await _invoiceRepository.GetInvoicesTotal(invoiceQuery);
|
||||
const int PAGE_SIZE = 1000;
|
||||
var totalPages = Math.Ceiling(totalCount * 1.0m / PAGE_SIZE);
|
||||
Logs.PayServer.LogInformation($"Importing {totalCount} invoices into the text search table in {totalPages - startFromPage} pages");
|
||||
Logs.PayServer.LogInformation($"Importing {totalCount} invoices into the search table in {totalPages - startFromPage} pages");
|
||||
for (int i = startFromPage; i < totalPages && !CancellationToken.IsCancellationRequested; i++)
|
||||
{
|
||||
Logs.PayServer.LogInformation($"Import to text search table progress: {i}/{totalPages} pages");
|
||||
Logs.PayServer.LogInformation($"Import to search table progress: {i + 1}/{totalPages} pages");
|
||||
// migrate data to new table using invoices from database
|
||||
using var ctx = _dbContextFactory.CreateContext();
|
||||
invoiceQuery.Skip = i * PAGE_SIZE;
|
||||
|
@ -116,6 +116,7 @@ namespace BTCPayServer.HostedServices
|
|||
_settingsRepository.UpdateSettingInContext(ctx, settings);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
Logs.PayServer.LogInformation($"Full invoice search import successful");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue