aboutsummaryrefslogtreecommitdiff
path: root/src/Database/initdatabase.cpp
diff options
context:
space:
mode:
authorDarkelarious <github@333networks.com>2025-05-04 16:08:07 +0200
committerDarkelarious <github@333networks.com>2025-05-04 16:08:07 +0200
commit8e1fdbe10862ccba3bdff2389c1bb732c6e84da4 (patch)
tree7cbbb5984f8fc5676cd610c388952caa1226c286 /src/Database/initdatabase.cpp
parent10bd168b65766026ae47eb7619f9fe74ced75e16 (diff)
downloadMasterserver-Qt5-8e1fdbe10862ccba3bdff2389c1bb732c6e84da4.tar.gz
Masterserver-Qt5-8e1fdbe10862ccba3bdff2389c1bb732c6e84da4.zip
database pragmas and timeout restraintsHEADmain
Diffstat (limited to 'src/Database/initdatabase.cpp')
-rw-r--r--src/Database/initdatabase.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Database/initdatabase.cpp b/src/Database/initdatabase.cpp
index c3b4823..fb99dfa 100644
--- a/src/Database/initdatabase.cpp
+++ b/src/Database/initdatabase.cpp
@@ -14,9 +14,10 @@ bool initDatabase(const QString applicationPath)
return false;
}
- // speed up SQLite with keeping journals in memory and asynchronous writing
+ // SQLite tweaks with async, wal and timeout
dbi.exec("PRAGMA synchronous = OFF");
- dbi.exec("PRAGMA journal_mode = MEMORY");
+ dbi.exec("PRAGMA journal_mode = WAL"); // previous: MEMORY
+ dbi.exec("PRAGMA busy_timeout = 500"); // 500ms
{ // check if the database was generated with this version of the software