Simplify implementation of build retry service
This commit is contained in:
parent
d4522de2fd
commit
108d3765ab
1 changed files with 2 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue