Page MenuHomeSoftware Heritage
Paste P598

Update lost tasks' status following rabbitmq restart
ActivePublic

Authored by ardumont on Feb 27 2020, 10:09 AM.
with lost_task_runs as (
select task_run.id
from task
inner join task_run on task.id = task_run.task
where task.policy = 'recurring' and
task.status = 'next_run_scheduled' and
task_run.status='scheduled' and
task_run.scheduled < now() - '1 days'::interval
limit 1000
)
update task_run
set status = 'lost'
from lost_task_runs
where task_run.id = lost_task_runs.id;

Event Timeline

ardumont edited the content of this paste. (Show Details)