diff options
Diffstat (limited to 'Emby.Server.Implementations/Data/BaseSqliteRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/BaseSqliteRepository.cs | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index dc5d00985..6c1a96813 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -64,25 +64,50 @@ namespace Emby.Server.Implementations.Data var db = SQLite3.Open(DbFilePath, connectionFlags, null); - var queries = new[] + var queries = new List<string> { + "pragma default_temp_store = memory", "PRAGMA page_size=4096", "PRAGMA journal_mode=WAL", "PRAGMA temp_store=memory", "PRAGMA synchronous=Normal", //"PRAGMA cache size=-10000" - }; + }; + + var cacheSize = CacheSize; + if (cacheSize.HasValue) + { + + } + + if (EnableExclusiveMode) + { + queries.Add("PRAGMA locking_mode=EXCLUSIVE"); + } //foreach (var query in queries) //{ // db.Execute(query); //} - db.ExecuteAll(string.Join(";", queries)); + db.ExecuteAll(string.Join(";", queries.ToArray())); return db; } + protected virtual int? CacheSize + { + get + { + return null; + } + } + + protected virtual bool EnableExclusiveMode + { + get { return false; } + } + internal static void CheckOk(int rc) { string msg = ""; |
