aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/BaseSqliteRepository.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Data/BaseSqliteRepository.cs')
-rw-r--r--Emby.Server.Implementations/Data/BaseSqliteRepository.cs20
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;
}