diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-04 16:34:22 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-04 16:34:22 +0200 |
commit | 7f270d041da55e1fd5c378dcf2291ba752a9114d (patch) | |
tree | dd90db722af2b7f0c30ac069e092870f2953ec09 | |
parent | 4e4640b10bfae9bfa1da265775ede57ea72c358c (diff) | |
download | gitlab-ce-7f270d041da55e1fd5c378dcf2291ba752a9114d.tar.gz |
Do not return false in commit status transitionfeature/improve-async-pipeline-processing
-rw-r--r-- | app/models/commit_status.rb | 2 | ||||
-rw-r--r-- | app/workers/process_pipeline_worker.rb | 5 | ||||
-rw-r--r-- | app/workers/update_pipeline_worker.rb | 5 |
3 files changed, 5 insertions, 7 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 4bb4211dfe3..b0b4f94e070 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -71,7 +71,7 @@ class CommitStatus < ActiveRecord::Base after_transition do |commit_status, transition| commit_status.pipeline.try do |pipeline| - return false if transition.loopback? + break if transition.loopback? if commit_status.complete? ProcessPipelineWorker.perform_async(pipeline.id) diff --git a/app/workers/process_pipeline_worker.rb b/app/workers/process_pipeline_worker.rb index 189cfa207ff..26ea5f1c24d 100644 --- a/app/workers/process_pipeline_worker.rb +++ b/app/workers/process_pipeline_worker.rb @@ -4,8 +4,7 @@ class ProcessPipelineWorker sidekiq_options queue: :default def perform(pipeline_id) - Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline| - pipeline.process! - end + Ci::Pipeline.find_by(id: pipeline_id) + .try(:process!) end end diff --git a/app/workers/update_pipeline_worker.rb b/app/workers/update_pipeline_worker.rb index 9fd622a0970..6ef5678073e 100644 --- a/app/workers/update_pipeline_worker.rb +++ b/app/workers/update_pipeline_worker.rb @@ -4,8 +4,7 @@ class UpdatePipelineWorker sidekiq_options queue: :default def perform(pipeline_id) - Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline| - pipeline.update_status - end + Ci::Pipeline.find_by(id: pipeline_id) + .try(:update_status) end end |