From eedf189d44becf2f3f07439d10e5cf92e8d3655a Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Mon, 11 Jan 2021 23:41:05 +0900 Subject: [PATCH] Improve logs of the invoice text search import --- BTCPayServer/HostedServices/DbMigrationsHostedService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BTCPayServer/HostedServices/DbMigrationsHostedService.cs b/BTCPayServer/HostedServices/DbMigrationsHostedService.cs index 8e1feefda..82d47e1dc 100644 --- a/BTCPayServer/HostedServices/DbMigrationsHostedService.cs +++ b/BTCPayServer/HostedServices/DbMigrationsHostedService.cs @@ -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"); } } }