diff options
| author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-21 09:44:35 +0200 |
|---|---|---|
| committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-10-21 09:44:35 +0200 |
| commit | 1dc34b714cc18264e73a8e4d722b067d155d8ab1 (patch) | |
| tree | 2310448800d21ce631cbf67d744352fdd6a9fbcd /app/models/commit_status.rb | |
| parent | 04f731f3ada7c8ff7832275f6838ea687c7f6bbe (diff) | |
| download | gitlab-ce-fix/improve-concurrent-pipeline-processing.tar.gz | |
Schedule pipeline worker only when it is uniquefix/improve-concurrent-pipeline-processing
Diffstat (limited to 'app/models/commit_status.rb')
| -rw-r--r-- | app/models/commit_status.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 7b554be4f9a..4b6b996a462 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -90,11 +90,8 @@ class CommitStatus < ActiveRecord::Base commit_status.run_after_commit do pipeline.try do |pipeline| - if complete? - PipelineProcessWorker.perform_async(pipeline.id) - else - PipelineUpdateWorker.perform_async(pipeline.id) - end + worker = complete? ? PipelineProcessWorker : PipelineUpdateWorker + Gitlab::Worker::Unique.new(worker, pipeline.id).schedule! end end end |
