Przeglądaj źródła

Address review comments

Fernando Fernández 4 lat temu
rodzic
commit
6db229af5d
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      Jellyfin.Server/Program.cs

+ 3 - 3
Jellyfin.Server/Program.cs

@@ -222,15 +222,15 @@ namespace Jellyfin.Server
             }
             }
             finally
             finally
             {
             {
-                appHost.Dispose();
                 _logger.LogInformation("Running query planner optimizations in the database... This might take a while");
                 _logger.LogInformation("Running query planner optimizations in the database... This might take a while");
-
-                // Run after disposing the application
+                // Run before disposing the application
                 using var context = new JellyfinDbProvider(appHost.ServiceProvider, appPaths).CreateContext();
                 using var context = new JellyfinDbProvider(appHost.ServiceProvider, appPaths).CreateContext();
                 if (context.Database.IsSqlite())
                 if (context.Database.IsSqlite())
                 {
                 {
                     context.Database.ExecuteSqlRaw("PRAGMA optimize");
                     context.Database.ExecuteSqlRaw("PRAGMA optimize");
                 }
                 }
+
+                appHost.Dispose();
             }
             }
 
 
             if (_restartOnShutdown)
             if (_restartOnShutdown)