fix: configure SQLite WAL mode and busy_timeout to prevent database locked errors

- Enable WAL journal mode for concurrent read/write support
- Set busy_timeout to 30s to wait on locks instead of failing immediately
- Set synchronous to normal for better write performance

Fixes #770
This commit is contained in:
xboard
2026-03-11 07:56:27 +08:00
parent 8bb4682e98
commit 1e069587fe

View File

@@ -41,6 +41,9 @@ return [
'database' => env('DB_DATABASE') ? base_path(env('DB_DATABASE')) : database_path('database.sqlite'),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => env('DB_BUSY_TIMEOUT', 30000),
'journal_mode' => env('DB_JOURNAL_MODE', 'wal'),
'synchronous' => env('DB_SYNCHRONOUS', 'normal'),
],
'mysql' => [