Retry access in case the settings database is locked

This commit is contained in:
df 2020-10-20 18:34:19 +00:00
parent 3e9ecc8a7c
commit 7c600be77e

View File

@ -60,7 +60,7 @@ proc {settings _safer_query} { queryText args } {
# allow 4 tries from 0.5s delay, doubling, to get access
for {set lockCnt 4; set delay 0.5} {true} {sleep $delay; set delay $(2*$delay)} {
try {
return [$settingsdb query $queryText {*}$arg]
return [$settingsdb query $queryText {*}$args]
} on error {msg opts} {
if {[string first "database is locked" $msg] >= 0} {
if {[incr lockCnt -1] > 0} {