Merge pull request 'Fix incorrectly constructed query list, restore purging completed entries' (#46) from df/webif:df-queue-safer-patchv2 into master

Reviewed-on: hummypkg/webif#46
This commit is contained in:
prpr 2022-03-25 22:54:02 +00:00
commit 4f5ba6f14f

View File

@ -146,7 +146,7 @@ proc {queue dbqueryl} {query_list {txn_mode ""}} {
proc {queue startup} {{days 7}} {
if {$days == 0} { set days 7 }
return [queue dbqueryl { { {
return [queue dbqueryl [list { {
update queue
set status = 'INTERRUPTED',
log = 'Job will be retried automatically.',
@ -163,12 +163,12 @@ proc {queue startup} {{days 7}} {
update queue
set status = 'PENDING'
where status = 'DEFER'
} } { {
} } [list {
delete from queue
where status in ('COMPLETE', 'FAILED')
and submitted < %s
} [expr [clock seconds] - 86400 * $days]
} } ]
] ] ]
}
proc {queue fetch} {file action} {