Polish Part 3 (#2424)

This commit is contained in:
Joe Milazzo 2023-11-10 07:56:30 -06:00 committed by GitHub
parent a018d6828e
commit 944830ca73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 518 additions and 493 deletions

View file

@ -225,13 +225,13 @@ public class Startup
IDirectoryService directoryService, IUnitOfWork unitOfWork, IBackupService backupService, IImageService imageService)
{
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
// Apply Migrations
try
{
Task.Run(async () =>
{
// Apply all migrations on startup
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
var userManager = serviceProvider.GetRequiredService<UserManager<AppUser>>();
var dataContext = serviceProvider.GetRequiredService<DataContext>();
@ -256,7 +256,6 @@ public class Startup
}
catch (Exception ex)
{
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
logger.LogCritical(ex, "An error occurred during migration");
}
@ -377,7 +376,6 @@ public class Startup
{
try
{
var logger = serviceProvider.GetRequiredService<ILogger<Startup>>();
logger.LogInformation("Kavita - v{Version}", BuildInfo.Version);
}
catch (Exception)
@ -387,8 +385,7 @@ public class Startup
Console.WriteLine($"Kavita - v{BuildInfo.Version}");
});
var _logger = serviceProvider.GetRequiredService<ILogger<Startup>>();
_logger.LogInformation("Starting with base url as {BaseUrl}", basePath);
logger.LogInformation("Starting with base url as {BaseUrl}", basePath);
}
private static void UpdateBaseUrlInIndex(string baseUrl)