The Free Software Media System - Server Backend & API
Add DbContext Pool
Patrick Barrond8865322588c
diff --git a/Jellyfin.Server/CoreAppHost.cs b/Jellyfin.Server/CoreAppHost.csindex 29a59e1c8a..7b20bfb5af 100644--- a/Jellyfin.Server/CoreAppHost.cs+++ b/Jellyfin.Server/CoreAppHost.cs@@ -64,12 +64,8 @@ namespace Jellyfin.ServerLogger.LogWarning($"Skia not available. Will fallback to {nameof(NullImageEncoder)}.");}- // TODO: Set up scoping and use AddDbContextPool,- // can't register as Transient since tracking transient in GC is funky- // serviceCollection.AddDbContext<JellyfinDb>(- // options => options- // .UseSqlite($"Filename={Path.Combine(ApplicationPaths.DataPath, "jellyfin.db")}"),- // ServiceLifetime.Transient);+ serviceCollection.AddDbContextPool<JellyfinDb>(+ options => options.UseSqlite($"Filename={Path.Combine(ApplicationPaths.DataPath, "jellyfin.db")}"));serviceCollection.AddSingleton<JellyfinDbProvider>();