Address review comments

This commit is contained in:
Fernando Fernández 2021-05-24 10:48:01 +02:00
parent 3b822116ed
commit 6db229af5d
No known key found for this signature in database
GPG Key ID: 44495B839CCFF8CF
1 changed files with 3 additions and 3 deletions

View File

@ -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)