mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
Use appHost.Resolve for accessing the context in Program.cs
This commit is contained in:
parent
ec35b8b425
commit
59b67584fc
|
@ -224,7 +224,7 @@ namespace Jellyfin.Server
|
||||||
{
|
{
|
||||||
_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
|
||||||
using var context = new JellyfinDbProvider(appHost.ServiceProvider, appPaths).CreateContext();
|
using var context = appHost.Resolve<JellyfinDbProvider>().CreateContext();
|
||||||
if (context.Database.IsSqlite())
|
if (context.Database.IsSqlite())
|
||||||
{
|
{
|
||||||
context.Database.ExecuteSqlRaw("PRAGMA optimize");
|
context.Database.ExecuteSqlRaw("PRAGMA optimize");
|
||||||
|
|
Loading…
Reference in a new issue