fix: Add busy_timeout to sqlite to avoid error SQLITE_BUSY: database is locked (#7307)
Auto Test / auto-test (20, macos-latest) (push) Has been cancelled
Auto Test / auto-test (20, ubuntu-22.04) (push) Has been cancelled
Auto Test / auto-test (20, ubuntu-22.04-arm) (push) Has been cancelled
Auto Test / auto-test (20, windows-latest) (push) Has been cancelled
Auto Test / auto-test (24, macos-latest) (push) Has been cancelled
Auto Test / auto-test (24, ubuntu-22.04) (push) Has been cancelled
Auto Test / auto-test (24, ubuntu-22.04-arm) (push) Has been cancelled
Auto Test / auto-test (24, windows-latest) (push) Has been cancelled
Auto Test / auto-test (25, ubuntu-22.04) (push) Has been cancelled
Auto Test / armv7-simple-test (20) (push) Has been cancelled
Auto Test / armv7-simple-test (22) (push) Has been cancelled
Auto Test / check-linters (push) Has been cancelled
Auto Test / e2e-test (push) Has been cancelled
autofix.ci / autofix (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / zizmor (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
validate / json-yaml-validate (push) Has been cancelled
validate / validate (push) Has been cancelled

This commit is contained in:
Andreas Wagner
2026-05-02 14:24:00 +02:00
committed by GitHub
parent 9e84e3cbc0
commit 913105f2de
+3
View File
@@ -435,6 +435,9 @@ class Database {
await asyncRun("PRAGMA cache_size = -12000");
await asyncRun("PRAGMA auto_vacuum = INCREMENTAL");
// Avoid error "SQLITE_BUSY: database is locked" by allowing SQLITE to wait up to 5 seconds to do a write
await asyncRun("PRAGMA busy_timeout = 5000");
// This ensures that an operating system crash or power failure will not corrupt the database.
// FULL synchronous is very safe, but it is also slower.
// Read more: https://sqlite.org/pragma.html#pragma_synchronous