Commit 82e6efb8 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Avoid race condition in build retry service

parent 108d3765
......@@ -2,14 +2,13 @@ module Ci
class RetryBuildService < ::BaseService
def execute(build)
reprocess(build).tap do |new_build|
build.pipeline.mark_as_processable_after_stage(build.stage_idx)
new_build.enqueue!
MergeRequests::AddTodoWhenBuildFailsService
.new(build.project, current_user)
.close(new_build)
build.pipeline
.mark_as_processable_after_stage(build.stage_idx)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment