summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-09-12 18:49:58 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-09-12 18:49:58 +0800
commit3bb409d2eeaa36921149984065b10e6d9394e641 (patch)
treea45f7f916dce36ae51b7d0569b9de868620b0784 /app
parent45afdbef0de58f6de207b057e47151611d2ad7e6 (diff)
downloadgitlab-ce-3bb409d2eeaa36921149984065b10e6d9394e641.tar.gz
Make the cases clear instead of having guardsslightly-more-readable
Diffstat (limited to 'app')
-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