Explorar o código

Use appHost.Resolve for accessing the context in Program.cs

Fernando Fernández %!s(int64=4) %!d(string=hai) anos
pai
achega
59b67584fc
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Jellyfin.Server/Program.cs

+ 1 - 1
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<JellyfinDbProvider>().CreateContext();
                 if (context.Database.IsSqlite())
                 {
                     context.Database.ExecuteSqlRaw("PRAGMA optimize");