diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-04-07 14:47:15 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-04-07 14:47:15 +0800 |
commit | 38796f56173caa2ed6575a4f60f7bf07ed90af55 (patch) | |
tree | 0189a4f8b55fae0e9eb5a476656348f72af5d63f | |
parent | f8fe64a630b2adff8d260c7cc92f89ff8cfd0519 (diff) | |
download | gitlab-ce-38796f56173caa2ed6575a4f60f7bf07ed90af55.tar.gz |
Fix bad conflict resolution
-rw-r--r-- | app/models/ci/pipeline.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 134ca5f60a3..1f47756269e 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -228,13 +228,12 @@ module Ci end def cancel_running - Gitlab::OptimisticLocking.retry_lock( - statuses.cancelable) do |cancelable| - cancelable.find_each do |job| - yield(job) if block_given? - job.cancel - end + Gitlab::OptimisticLocking.retry_lock(cancelable_statuses) do |cancelable| + cancelable.find_each do |job| + yield(job) if block_given? + job.cancel end + end end def auto_cancel_running(pipeline) |