diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-14 13:29:58 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-14 13:29:58 +0100 |
commit | 056f1b702042382c99dcfdaf1e292bf68b8f55ba (patch) | |
tree | 38fa1c55ce9c67ac48faa1d35dfb9d68561af25c /app/models | |
parent | 94495f984c0a81d32b6f748fd977848dc5c6721e (diff) | |
download | gitlab-ce-056f1b702042382c99dcfdaf1e292bf68b8f55ba.tar.gz |
Simplify implementation of pipeline retry service
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/ci/pipeline.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 49bd2e1d7f0..dc4590a9923 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -214,13 +214,7 @@ module Ci def cancel_running Gitlab::OptimisticLocking.retry_lock( statuses.cancelable) do |cancelable| - cancelable.each do |status| - if status.created? - status.skip - elsif status.active? - status.cancel - end - end + cancelable.find_each(&:cancel) end end |