Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-04 13:25:06 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-10-04 15:43:58 +0300
commitf57cfdb6b527fe20f64f8a76339264948c3b358b (patch)
treea75b36b023086ca07c83a280abaa810dbc38647e /app/workers
parentebeee31100cb142dfc74ec02928d3c5433eab8d7 (diff)
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