diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-04 12:25:06 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-04 14:43:58 +0200 |
commit | f57cfdb6b527fe20f64f8a76339264948c3b358b (patch) | |
tree | a75b36b023086ca07c83a280abaa810dbc38647e /app/workers | |
parent | ebeee31100cb142dfc74ec02928d3c5433eab8d7 (diff) | |
download | gitlab-ce-f57cfdb6b527fe20f64f8a76339264948c3b358b.tar.gz |
Update order of build transition callbacks
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/process_pipeline_worker.rb | 7 | ||||
-rw-r--r-- | app/workers/update_pipeline_worker.rb | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/app/workers/process_pipeline_worker.rb b/app/workers/process_pipeline_worker.rb index 9aad8cf818f..189cfa207ff 100644 --- a/app/workers/process_pipeline_worker.rb +++ b/app/workers/process_pipeline_worker.rb @@ -4,9 +4,8 @@ class ProcessPipelineWorker sidekiq_options queue: :default def perform(pipeline_id) - pipeline = Ci::Pipeline.find_by(id: pipeline_id) - return unless pipeline - - pipeline.process! + Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline| + pipeline.process! + end end end diff --git a/app/workers/update_pipeline_worker.rb b/app/workers/update_pipeline_worker.rb index 31d29d0ab1c..9fd622a0970 100644 --- a/app/workers/update_pipeline_worker.rb +++ b/app/workers/update_pipeline_worker.rb @@ -4,9 +4,8 @@ class UpdatePipelineWorker sidekiq_options queue: :default def perform(pipeline_id) - pipeline = Ci::Pipeline.find_by(id: pipeline_id) - return unless pipeline - - pipeline.update_status + Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline| + pipeline.update_status + end end end |