summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-04 12:25:06 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-04 14:43:58 +0200
commitf57cfdb6b527fe20f64f8a76339264948c3b358b (patch)
treea75b36b023086ca07c83a280abaa810dbc38647e /app/workers
parentebeee31100cb142dfc74ec02928d3c5433eab8d7 (diff)
downloadgitlab-ce-f57cfdb6b527fe20f64f8a76339264948c3b358b.tar.gz
Update order of build transition callbacks
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/process_pipeline_worker.rb7
-rw-r--r--app/workers/update_pipeline_worker.rb7
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