diff options
| author | Bond_009 <bond.009@outlook.com> | 2023-01-09 00:07:53 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2023-01-14 21:39:46 +0100 |
| commit | ab918c6292bb27a0e39f3d54f0f449b97246e59b (patch) | |
| tree | 23a1c550b6dc42b448dece78f2eb63b74491419f /Emby.Server.Implementations/Data/BaseSqliteRepository.cs | |
| parent | 56ef45ebf004cd444066335084111781b983e853 (diff) | |
Fine tune DB settings
Diffstat (limited to 'Emby.Server.Implementations/Data/BaseSqliteRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/BaseSqliteRepository.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs index ff9aa4c2a..230f633a7 100644 --- a/Emby.Server.Implementations/Data/BaseSqliteRepository.cs +++ b/Emby.Server.Implementations/Data/BaseSqliteRepository.cs @@ -61,10 +61,15 @@ namespace Emby.Server.Implementations.Data protected virtual int? CacheSize => null; /// <summary> + /// Gets the locking mode. <see href="https://www.sqlite.org/pragma.html#pragma_locking_mode" />. + /// </summary> + protected virtual string LockingMode => "EXCLUSIVE"; + + /// <summary> /// Gets the journal mode. <see href="https://www.sqlite.org/pragma.html#pragma_journal_mode" />. /// </summary> /// <value>The journal mode.</value> - protected virtual string JournalMode => "TRUNCATE"; + protected virtual string JournalMode => "WAL"; /// <summary> /// Gets the page size. @@ -116,6 +121,11 @@ namespace Emby.Server.Implementations.Data WriteConnection.Execute("PRAGMA cache_size=" + CacheSize.Value); } + if (!string.IsNullOrWhiteSpace(LockingMode)) + { + WriteConnection.Execute("PRAGMA locking_mode=" + LockingMode); + } + if (!string.IsNullOrWhiteSpace(JournalMode)) { WriteConnection.Execute("PRAGMA journal_mode=" + JournalMode); |
