diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-14 15:51:12 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-14 15:51:12 +0300 |
commit | 82e6efb8099f2e54c1201dba815d4082f1e01a55 (patch) | |
tree | f58c5b725eed4709f1fc9155951e2859a5566870 /app/services | |
parent | 108d3765abe224b99084e4e01e58d219638757a6 (diff) |
Avoid race condition in build retry service
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/ci/retry_build_service.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/services/ci/retry_build_service.rb b/app/services/ci/retry_build_service.rb index 3ce7a092e72..ed4694237f6 100644 --- a/app/services/ci/retry_build_service.rb +++ b/app/services/ci/retry_build_service.rb @@ -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 |