Skip to content
Snippets Groups Projects
Commit 11378fd6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Cleanup builds

parent bcf5fbe2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -126,7 +126,8 @@ class Project < ActiveRecord::Base
end
 
def no_running_builds?
builds.running.empty?
# Get running builds not later than 3 days ago to ignore hungs
builds.running.where("updated_at < ?", 3.days.ago).empty?
end
end
 
Loading
Loading
namespace :cleanup do
desc "GITLAB | Clean running builds"
task builds: :environment do
Build.running.update_all(status: 'canceled')
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment