Fine tune DB settings

This commit is contained in:
Bond_009
2023-01-09 00:07:53 +01:00
parent 56ef45ebf0
commit ab918c6292
3 changed files with 11 additions and 7 deletions

View File

@@ -60,11 +60,16 @@ namespace Emby.Server.Implementations.Data
/// <value>The cache size or null.</value>
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);