mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
Prevent additional errors on startup/shutdown (#6788)
This commit is contained in:
parent
a2127a48ef
commit
c16d71562e
|
@ -223,6 +223,9 @@ namespace Jellyfin.Server
|
||||||
_logger.LogCritical(ex, "Error while starting server.");
|
_logger.LogCritical(ex, "Error while starting server.");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
{
|
||||||
|
// Don't throw additional exception if startup failed.
|
||||||
|
if (appHost.ServiceProvider != null)
|
||||||
{
|
{
|
||||||
_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 before disposing the application
|
// Run before disposing the application
|
||||||
|
@ -231,6 +234,7 @@ namespace Jellyfin.Server
|
||||||
{
|
{
|
||||||
context.Database.ExecuteSqlRaw("PRAGMA optimize");
|
context.Database.ExecuteSqlRaw("PRAGMA optimize");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
appHost.Dispose();
|
appHost.Dispose();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue