mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
wallet/db_sqlite3.c: Increase busy timeout to 60 seconds.
Closes: #4860 ChangeLog-Added: With `sqlite3` db backend we now use a 60-second busy timer, to allow backup processes like `litestream` to operate safely.
This commit is contained in:
parent
c012a71dec
commit
ab026fb4de
@ -41,10 +41,13 @@ static bool db_sqlite3_setup(struct db *db)
|
||||
}
|
||||
db->conn = sql;
|
||||
|
||||
/* In case another writer (litestream?) grabs a lock, we don't
|
||||
/* In case another process (litestream?) grabs a lock, we don't
|
||||
* want to return SQLITE_BUSY immediately (which will cause a
|
||||
* fatal error): give it 5 seconds. */
|
||||
sqlite3_busy_timeout(db->conn, 5000);
|
||||
* fatal error): give it 60 seconds.
|
||||
* We *could* make this an option, but surely the user prefers a
|
||||
* long timeout over an outright crash.
|
||||
*/
|
||||
sqlite3_busy_timeout(db->conn, 60000);
|
||||
|
||||
sqlite3_prepare_v2(db->conn, "PRAGMA foreign_keys = ON;", -1, &stmt, NULL);
|
||||
err = sqlite3_step(stmt);
|
||||
|
Loading…
Reference in New Issue
Block a user