From 92cf390fb0d8cb23d56128591e15f496210fcc7e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 21 Nov 2016 15:22:43 -0500 Subject: update user data db --- .../Data/BaseSqliteRepository.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Emby.Server.Implementations/Data/BaseSqliteRepository.cs') diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index d4226ec25..5c60a6f86 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -42,7 +42,7 @@ namespace Emby.Server.Implementations.Data private string _defaultWal; - protected SQLiteDatabaseConnection CreateConnection(bool isReadOnly = false, Action onConnect = null) + protected SQLiteDatabaseConnection CreateConnection(bool isReadOnly = false) { if (!_versionLogged) { @@ -88,9 +88,8 @@ namespace Emby.Server.Implementations.Data var queries = new List { - "PRAGMA default_temp_store=memory", - "pragma temp_store = memory", - "PRAGMA journal_mode=WAL" + "PRAGMA temp_store = memory", + //"PRAGMA journal_mode=WAL" //"PRAGMA cache size=-10000" }; @@ -108,18 +107,19 @@ namespace Emby.Server.Implementations.Data //Logger.Info("synchronous: " + db.Query("PRAGMA synchronous").SelectScalarString().First()); //Logger.Info("temp_store: " + db.Query("PRAGMA temp_store").SelectScalarString().First()); - //if (!string.Equals(_defaultWal, "wal", StringComparison.OrdinalIgnoreCase) || onConnect != null) + if (!string.Equals(_defaultWal, "wal", StringComparison.OrdinalIgnoreCase)) { + queries.Add("PRAGMA journal_mode=WAL"); + using (WriteLock.Write()) { db.ExecuteAll(string.Join(";", queries.ToArray())); - - if (onConnect != null) - { - onConnect(db); - } } } + else + { + db.ExecuteAll(string.Join(";", queries.ToArray())); + } return db; } -- cgit v1.2.3