diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-11-21 15:42:30 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-11-21 15:42:30 -0500 |
| commit | 6ce6600a3e86206706f527b7951f51da3a515348 (patch) | |
| tree | 105fd73bca3c2a193ad71e31b949ba3a9b0fde8a /Emby.Server.Implementations/Data/BaseSqliteRepository.cs | |
| parent | 625094a04638f180121c732b4c78240e62b1ce81 (diff) | |
| parent | 92cf390fb0d8cb23d56128591e15f496210fcc7e (diff) | |
Merge pull request #2302 from MediaBrowser/dev
update user data db
Diffstat (limited to 'Emby.Server.Implementations/Data/BaseSqliteRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/BaseSqliteRepository.cs | 20 |
1 files changed, 10 insertions, 10 deletions
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<SQLiteDatabaseConnection> onConnect = null) + protected SQLiteDatabaseConnection CreateConnection(bool isReadOnly = false) { if (!_versionLogged) { @@ -88,9 +88,8 @@ namespace Emby.Server.Implementations.Data var queries = new List<string> { - "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; } |
