From a9c6f522e6ae592b0589853577e071c8c2364811 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 16 Aug 2013 15:15:13 +0200 Subject: [PATCH] clear_queue_non_current: Don't use isCurrent --- src/lib/Hydra/Controller/Admin.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/Admin.pm b/src/lib/Hydra/Controller/Admin.pm index c9ef09fc..d533ed5c 100644 --- a/src/lib/Hydra/Controller/Admin.pm +++ b/src/lib/Hydra/Controller/Admin.pm @@ -35,7 +35,11 @@ sub machines : Chained('admin') PathPart('machines') Args(0) { sub clear_queue_non_current : Chained('admin') PathPart('clear-queue-non-current') Args(0) { my ($self, $c) = @_; my $time = time(); - $c->model('DB::Builds')->search({finished => 0, iscurrent => 0, busy => 0})->update({ finished => 1, buildstatus => 4, starttime => $time, stoptime => $time }); + $c->model('DB::Builds')->search( + { finished => 0, busy => 0 + , id => { -not_in => \ "select build from JobsetEvalMembers where eval in (select max(id) from JobsetEvals where hasNewBuilds = 1 group by project, jobset)" } + }, {}) + ->update({ finished => 1, buildstatus => 4, starttime => $time, stoptime => $time }); $c->res->redirect($c->request->referer // "/admin"); }