From 6db229af5deb6a00035ddcfebc4fd9db3b6a5336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Mon, 24 May 2021 10:48:01 +0200 Subject: [PATCH] Address review comments --- Jellyfin.Server/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index d0f10b4678..3a3d7415bf 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -222,15 +222,15 @@ namespace Jellyfin.Server } finally { - appHost.Dispose(); _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(); if (context.Database.IsSqlite()) { context.Database.ExecuteSqlRaw("PRAGMA optimize"); } + + appHost.Dispose(); } if (_restartOnShutdown)