comparison 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
comparison
equal deleted inserted replaced
13950:d00409d2329f 13965:b7714c28442f
993 end 993 end
994 engine:execute("PRAGMA synchronous=EXTRA;") 994 engine:execute("PRAGMA synchronous=EXTRA;")
995 engine:execute("PRAGMA fullfsync=1;") 995 engine:execute("PRAGMA fullfsync=1;")
996 end 996 end
997 997
998 engine:execute(("PRAGMA busy_timeout=%d;"):format(module:get_option_integer("sqlite_busy_timeout_ms", 1000, 0)));
999
998 for row in engine:select[[PRAGMA journal_mode;]] do 1000 for row in engine:select[[PRAGMA journal_mode;]] do
999 journal_mode = row[1]; 1001 journal_mode = row[1];
1000 end 1002 end
1001 1003
1002 module:log("debug", "SQLite3 database %q operating with journal_mode=%s", engine.params.database, journal_mode); 1004 module:log("debug", "SQLite3 database %q operating with journal_mode=%s", engine.params.database, journal_mode);