summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/commit_status.rb2
-rw-r--r--app/workers/process_pipeline_worker.rb5
-rw-r--r--app/workers/update_pipeline_worker.rb5
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