diff --git a/BTCPayServer/HostedServices/DbMigrationsHostedService.cs b/BTCPayServer/HostedServices/DbMigrationsHostedService.cs index 7b63263ad..b9425587f 100644 --- a/BTCPayServer/HostedServices/DbMigrationsHostedService.cs +++ b/BTCPayServer/HostedServices/DbMigrationsHostedService.cs @@ -120,10 +120,10 @@ namespace BTCPayServer.HostedServices Logs.PayServer.LogInformation($"Full invoice search import successful"); } - private Task CountInvoices() + private async Task CountInvoices() { using var ctx = _dbContextFactory.CreateContext(); - return ctx.Invoices.CountAsync(); + return await ctx.Invoices.CountAsync(); } } } diff --git a/BTCPayServer/Hosting/MigrationStartupTask.cs b/BTCPayServer/Hosting/MigrationStartupTask.cs index 65d6a9759..bc5f2b29a 100644 --- a/BTCPayServer/Hosting/MigrationStartupTask.cs +++ b/BTCPayServer/Hosting/MigrationStartupTask.cs @@ -82,7 +82,7 @@ namespace BTCPayServer.Hosting try { await Migrate(cancellationToken); - var settings = (await _Settings.GetSettingAsync()) ?? new MigrationSettings(); + var settings = (await _Settings.GetSettingAsync()) ?? new MigrationSettings() { MigratedInvoiceTextSearchPages = int.MaxValue }; if (!settings.PaymentMethodCriteria) { await MigratePaymentMethodCriteria();