Merge pull request #17558 from IDisposable/fix/set-cache-to-private
Switch SQLite connection Cache to Private
This commit is contained in:
@@ -63,7 +63,11 @@ public sealed class SqliteDatabaseProvider : IJellyfinDatabaseProvider
|
||||
var sqliteConnectionBuilder = new SqliteConnectionStringBuilder
|
||||
{
|
||||
DataSource = GetOption(customOptions, "path", e => e, () => Path.Combine(_applicationPaths.DataPath, "jellyfin.db")),
|
||||
Cache = GetOption(customOptions, "cache", Enum.Parse<SqliteCacheMode>, () => SqliteCacheMode.Default),
|
||||
// Private, not Default: sqlite3_enable_shared_cache is process-global, so a plugin
|
||||
// enabling it makes these connections share a cache too. Contention then surfaces as
|
||||
// SQLITE_LOCKED ("database table is locked"), which the busy handler does not cover,
|
||||
// so busy_timeout is skipped and the command fails at CommandTimeout instead.
|
||||
Cache = GetOption(customOptions, "cache", Enum.Parse<SqliteCacheMode>, () => SqliteCacheMode.Private),
|
||||
Pooling = GetOption(customOptions, "pooling", e => e.Equals(bool.TrueString, StringComparison.OrdinalIgnoreCase), () => true),
|
||||
DefaultTimeout = GetOption(customOptions, "command-timeout", int.Parse, () => 60)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user