summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-12 16:06:41 +0000
committerRémy Coutable <remy@rymai.me>2016-09-12 16:06:41 +0000
commitc829ca191bebf96748248d74f6270b7bd59eb054 (patch)
tree37abedf605aed61c294c5127bb73e664a9269349
parent12d4eea4c7a46ad3641f2c3a8ee182a16e4848e5 (diff)
parent3bb409d2eeaa36921149984065b10e6d9394e641 (diff)
downloadgitlab-ce-c829ca191bebf96748248d74f6270b7bd59eb054.tar.gz
Merge branch 'slightly-more-readable' into 'master'
Make the cases clear instead of having guards See merge request !6304
-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