Fix incorrectly constructed query list to restore purging completed entries

A constant list included an item that needed to be evaluated.
This commit is contained in:
df 2021-05-19 13:06:28 +01:00
parent ee4c121a54
commit 49a7e430cf

View File

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