Merge pull request #1857 from safing/fix/sqlite-busy-timeout
Some checks failed
Go / Linter (push) Failing after 18s
Go / Test & Build (push) Failing after 1s

Add a 3s busy timeout to SQLite database backend
This commit is contained in:
Alexandr Stelnykovych 2025-04-07 14:04:33 +03:00 committed by GitHub
commit eccda20802
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,6 +80,7 @@ func openSQLite(name, location string, printStmts bool) (*SQLite, error) {
"PRAGMA journal_mode=WAL;", // Corruption safe write ahead log for txs.
"PRAGMA synchronous=NORMAL;", // Best for WAL.
"PRAGMA cache_size=-10000;", // 10MB Cache.
"PRAGMA busy_timeout=3000;", // 3s (3000ms) timeout for locked tables.
}
for _, pragma := range pragmas {
_, err := db.Exec(pragma)