Commit 206e1f27 authored by Ilia Kosenko's avatar Ilia Kosenko

Merge branch 'nelbacha-master-patch-81616' into 'master'

Cancel pending stuck jobs when they are pending AND stuck

Closes gitlab-com/support/docs#31

See merge request gitlab-org/gitlab!19622
parents 639d0fae 9afaf7a0
...@@ -715,7 +715,7 @@ For more information, see the [confidential issue](../../user/project/issues/con ...@@ -715,7 +715,7 @@ For more information, see the [confidential issue](../../user/project/issues/con
```ruby ```ruby
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').each {|p| p.cancel} Ci::Pipeline.where(project_id: p.id).where(status: 'pending').each {|p| p.cancel if p.stuck?}
Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count Ci::Pipeline.where(project_id: p.id).where(status: 'pending').count
``` ```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment