Add busy timeout to database connection (#3593)

This commit is contained in:
DingDongSoLong4
2023-03-25 03:37:17 +02:00
committed by GitHub
parent 806964086b
commit 2bcab7b0be

View File

@@ -213,7 +213,7 @@ func (db *Database) Close() error {
func (db *Database) open(disableForeignKeys bool) (*sqlx.DB, error) { func (db *Database) open(disableForeignKeys bool) (*sqlx.DB, error) {
// https://github.com/mattn/go-sqlite3 // https://github.com/mattn/go-sqlite3
url := "file:" + db.dbPath + "?_journal=WAL&_sync=NORMAL" url := "file:" + db.dbPath + "?_journal=WAL&_sync=NORMAL&_busy_timeout=50"
if !disableForeignKeys { if !disableForeignKeys {
url += "&_fk=true" url += "&_fk=true"
} }