Fix. cleanup old tasks.
This commit is contained in:
@@ -14,7 +14,7 @@ elseif database.type == 'mysql' then
|
|||||||
now_add_sec_sql = "DATE_ADD(UTC_TIMESTAMP(), INTERVAL %s SECOND)"
|
now_add_sec_sql = "DATE_ADD(UTC_TIMESTAMP(), INTERVAL %s SECOND)"
|
||||||
elseif database.type == 'sqlite' then
|
elseif database.type == 'sqlite' then
|
||||||
date_utc_now_sql = "datetime('now')"
|
date_utc_now_sql = "datetime('now')"
|
||||||
now_add_sec_sql = "datetime('now', '+%s seconds')"
|
now_add_sec_sql = "datetime('now', '%s seconds')"
|
||||||
else
|
else
|
||||||
error("unsupported database type: " .. database.type)
|
error("unsupported database type: " .. database.type)
|
||||||
end
|
end
|
||||||
@@ -96,7 +96,7 @@ local release_stuck_tasks_sql = [[
|
|||||||
update v_fax_tasks
|
update v_fax_tasks
|
||||||
set task_status = 0, task_lock_time = NULL,
|
set task_status = 0, task_lock_time = NULL,
|
||||||
task_next_time = ]] .. date_utc_now_sql .. [[
|
task_next_time = ]] .. date_utc_now_sql .. [[
|
||||||
where task_lock_time < ]] .. now_add_sec_sql:format('3600') .. [[
|
where task_lock_time < ]] .. now_add_sec_sql:format('-3600') .. [[
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local remove_finished_tasks_sql = [[
|
local remove_finished_tasks_sql = [[
|
||||||
|
|||||||
Reference in New Issue
Block a user