summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-14 13:39:14 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-14 13:39:14 +0100
commit108d3765abe224b99084e4e01e58d219638757a6 (patch)
tree5aa9c79af7985eec2f608d2470e5beeb229119fb
parentd4522de2fd71f2d21118ceec50e8509114c7f64b (diff)
downloadgitlab-ce-108d3765abe224b99084e4e01e58d219638757a6.tar.gz
Simplify implementation of build retry service
-rw-r--r--app/services/ci/retry_build_service.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/services/ci/retry_build_service.rb b/app/services/ci/retry_build_service.rb
index 009fbeaff20..3ce7a092e72 100644
--- a/app/services/ci/retry_build_service.rb
+++ b/app/services/ci/retry_build_service.rb
@@ -1,9 +1,9 @@
module Ci
class RetryBuildService < ::BaseService
def execute(build)
- # return unless build.retryable?
+ reprocess(build).tap do |new_build|
+ new_build.enqueue!
- self.retry(build).tap do |new_build|
MergeRequests::AddTodoWhenBuildFailsService
.new(build.project, current_user)
.close(new_build)
@@ -13,12 +13,6 @@ module Ci
end
end
- def retry(build)
- self.reprocess(build).tap do |new_build|
- new_build.enqueue!
- end
- end
-
def reprocess(build)
unless can?(current_user, :update_build, build)
raise Gitlab::Access::AccessDeniedError