diff plugins/mod_storage_sql.lua @ 13965:b7714c28442f 13.0

mod_storage_sql: Set configurable wait time for locked SQLite3 database This tells SQLite3 to wait up to 1000 milliseconds (i.e. 1 second) for a locked database file to become unlocked before giving up.
author Kim Alvefur <zash@zash.se>
date Tue, 30 Sep 2025 16:11:49 +0200
parents 9a69918b5e63
children 1b300c5a79d7
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Thu Sep 25 16:51:06 2025 +0200
+++ b/plugins/mod_storage_sql.lua	Tue Sep 30 16:11:49 2025 +0200
@@ -995,6 +995,8 @@
 					engine:execute("PRAGMA fullfsync=1;")
 				end
 
+				engine:execute(("PRAGMA busy_timeout=%d;"):format(module:get_option_integer("sqlite_busy_timeout_ms", 1000, 0)));
+
 				for row in engine:select[[PRAGMA journal_mode;]] do
 					journal_mode = row[1];
 				end