forked from hummypkg/webif
Retry access in case the settings database is locked
This commit is contained in:
parent
42d03e25c6
commit
b9787a0a9f
@ -60,7 +60,7 @@ proc {settings _safer_query} { queryText args } {
|
|||||||
# allow 4 tries from 0.5s delay, doubling, to get access
|
# 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)} {
|
for {set lockCnt 4; set delay 0.5} {true} {sleep $delay; set delay $(2*$delay)} {
|
||||||
try {
|
try {
|
||||||
return [$settingsdb query $queryText {*}$arg]
|
return [$settingsdb query $queryText {*}$args]
|
||||||
} on error {msg opts} {
|
} on error {msg opts} {
|
||||||
if {[string first "database is locked" $msg] >= 0} {
|
if {[string first "database is locked" $msg] >= 0} {
|
||||||
if {[incr lockCnt -1] > 0} {
|
if {[incr lockCnt -1] > 0} {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user