Skip to content
Snippets Groups Projects
Unverified Commit 9fca500c authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

runner: Update task status only after sending the tasks to rabbitmq

Prior to this, the runner called the `grab_ready{_priority}_tasks` method.
Those method update the task's status to 'next_run_scheduled' at the listing
time. So it actually writes immediately to postgresql.

So, failing to write to rabbitmq would update the status anyway. So we change
the runner's calls to use the `peek_ready{_priority}_tasks` methods
instead. This now only gets the task list to schedule. And at the end of the
runner, there is a call of `mass_schedule_task_runs` method. This method is
now in charge to update the tasks' status to 'next_run_scheduled' within the
same transaction.

Refs. swh/infra/sysadm-environment#5512
parent b98f6f92
No related branches found
No related tags found
No related merge requests found
Pipeline #14008 failed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment