add links in admin page to clear queue (all non-running builds, and all non-running old (non-current) builds)

This commit is contained in:
Rob Vermaas
2012-02-16 15:31:12 +01:00
parent bb6ef9c2ed
commit 355135b6e8
2 changed files with 18 additions and 1 deletions

View File

@ -294,6 +294,18 @@ sub machine_disable : Chained('machine') PathPart('disable') Args(0) {
$c->res->redirect("/admin/machines");
}
sub clear_queue_non_current : Chained('admin') Path('clear-queue-non-current') Args(0) {
my ($self, $c) = @_;
$c->model('DB::Builds')->search({iscurrent => 0, busy => 0}, { join => 'schedulingInfo' })->delete_all;
$c->res->redirect("/admin");
}
sub clear_queue : Chained('admin') Path('clear-queue') Args(0) {
my ($self, $c) = @_;
$c->model('DB::Builds')->search({busy => 0}, { join => 'schedulingInfo' })->delete_all;
$c->res->redirect("/admin");
}
sub clearfailedcache : Chained('admin') Path('clear-failed-cache') Args(0) {
my ($self, $c) = @_;