Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-09-12 13:49:58 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-09-12 13:49:58 +0300
commit3bb409d2eeaa36921149984065b10e6d9394e641 (patch)
treea45f7f916dce36ae51b7d0569b9de868620b0784 /app/services
parent45afdbef0de58f6de207b057e47151611d2ad7e6 (diff)
Make the cases clear instead of having guards
Diffstat (limited to 'app/services')
-rw-r--r--app/services/ci/process_pipeline_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb
index de48a50774e..36c93dddadb 100644
--- a/app/services/ci/process_pipeline_service.rb
+++ b/app/services/ci/process_pipeline_service.rb
@@ -31,13 +31,13 @@ module Ci
current_status = status_for_prior_stages(index)
created_builds_in_stage(index).select do |build|
- process_build(build, current_status)
+ if HasStatus::COMPLETED_STATUSES.include?(current_status)
+ process_build(build, current_status)
+ end
end
end
def process_build(build, current_status)
- return false unless HasStatus::COMPLETED_STATUSES.include?(current_status)
-
if valid_statuses_for_when(build.when).include?(current_status)
build.enqueue
true