From 59b67584fc18f73278404be33ddc8b7ea92019a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Tue, 25 May 2021 16:47:29 +0200 Subject: [PATCH] Use appHost.Resolve for accessing the context in Program.cs --- Jellyfin.Server/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 6e87c8939f..3c0ee069d4 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -224,7 +224,7 @@ namespace Jellyfin.Server { _logger.LogInformation("Running query planner optimizations in the database... This might take a while"); // Run before disposing the application - using var context = new JellyfinDbProvider(appHost.ServiceProvider, appPaths).CreateContext(); + using var context = appHost.Resolve().CreateContext(); if (context.Database.IsSqlite()) { context.Database.ExecuteSqlRaw("PRAGMA optimize");