Commit 9afaf7a0 authored by Nourdin el Bacha's avatar Nourdin el Bacha

Cancel pending stuck jobs when they are pending AND stuck

parent edd86383
......@@ -715,7 +715,7 @@ For more information, see the [confidential issue](../../user/project/issues/con
```ruby
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
```
......
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