Update lib/Database.php
Update busytimeout to prevent locks, some more pragmas
This commit is contained in:
parent
597e9c8dfb
commit
e02a0b4e50
1 changed files with 125 additions and 121 deletions
|
@ -8,12 +8,16 @@ class Database
|
||||||
if (self::$handle === null) {
|
if (self::$handle === null) {
|
||||||
self::$handle = new SQLite3(SQLITE_DB);
|
self::$handle = new SQLite3(SQLITE_DB);
|
||||||
self::$handle->enableExceptions(true);
|
self::$handle->enableExceptions(true);
|
||||||
|
self::$handle->busyTimeout(60000);
|
||||||
|
|
||||||
$initialQueries = [
|
$initialQueries = [
|
||||||
"PRAGMA journal_mode = WAL",
|
"PRAGMA journal_mode = WAL",
|
||||||
"PRAGMA synchronous = OFF",
|
"PRAGMA synchronous = OFF",
|
||||||
"PRAGMA cache_size = 10000",
|
"PRAGMA cache_size = 10000",
|
||||||
"PRAGMA temp_store = MEMORY"
|
"PRAGMA mmap_size = 30000000000",
|
||||||
|
"PRAGMA temp_store = MEMORY",
|
||||||
|
"PRAGMA automatic_index = ON",
|
||||||
|
"PRAGMA optimize"
|
||||||
];
|
];
|
||||||
|
|
||||||
self::$handle->exec(implode(";", $initialQueries) . ";");
|
self::$handle->exec(implode(";", $initialQueries) . ";");
|
||||||
|
|
Loading…
Reference in a new issue