From df71a86183dfcfa2957e4e27a47bdab2e09df083 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Mon, 30 Apr 2012 22:13:53 +0200 Subject: [PATCH] Do not delete builds when clearing the queue. Fixes #8. --- src/lib/Hydra/Controller/Admin.pm | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/lib/Hydra/Controller/Admin.pm b/src/lib/Hydra/Controller/Admin.pm index c09d6cf1..4c50e164 100644 --- a/src/lib/Hydra/Controller/Admin.pm +++ b/src/lib/Hydra/Controller/Admin.pm @@ -325,16 +325,7 @@ sub machine_disable : Chained('machine') PathPart('disable') Args(0) { sub clear_queue_non_current : Chained('admin') Path('clear-queue-non-current') Args(0) { my ($self, $c) = @_; - # !!! Mark the builds as cancelled instead. - $c->model('DB::Builds')->search({finished => 0, iscurrent => 0, busy => 0})->delete_all; - $c->res->redirect("/admin"); -} - - -sub clear_queue : Chained('admin') Path('clear-queue') Args(0) { - my ($self, $c) = @_; - # !!! Mark the builds as cancelled instead. - $c->model('DB::Builds')->search({finished => 0, busy => 0})->delete_all; + $c->model('DB::Builds')->search({finished => 0, iscurrent => 0, busy => 0})->update({ finished => 1, buildstatus => 4, timestamp => time}); $c->res->redirect("/admin"); }