Skip to content

Commit

Permalink
Switch SQLite to WAL journal mode to handle indexing better with the …
Browse files Browse the repository at this point in the history
…live workload interfering
  • Loading branch information
Mark-H committed Feb 27, 2021
1 parent e6cfb49 commit 7d7db15
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Containers/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static function load(ContainerInterface $container)
$container['db'] = function (ContainerInterface $container) {
$dir = getenv('BASE_DIRECTORY') . 'db/db.sqlite';
$db = new \PDO('sqlite:' . $dir);
$db->exec('PRAGMA journal_mode=WAL;');
$db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$db->setAttribute(\PDO::ATTR_TIMEOUT, 10000);
return $db;
Expand Down

0 comments on commit 7d7db15

Please sign in to comment.