Backend: Follow-up: Unified RetryJob Service - use EventStore in run_after_commit block
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
This is an immediate follow-up to: !79636 (closed)
Ideally we could convert the
run_after_commitblock into:
new_job.run_after_commit do
event = Ci::JobRetriedEvent.new(data: { old_job_id: job.id, new_job_id: new_job.id }
::Gitlab::EventStore.publish(event)
end
and have the 3 side effects (the service objects from other domains) run asynchronously (instead of synchronously) as subscribers of the event. We could do this in a follow-up though.
Edited by 🤖 GitLab Bot 🤖