From ed361a0145272e8bbbdddb457540be6832c060c4 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 21 Apr 2015 08:09:25 +0200 Subject: [PATCH] Build.pm: Don't get isChannel using buildproducts. We now have a column for that, so no need for counting rows which was a bit inefficient anyway, because we only would have needed the first row in the result. Signed-off-by: aszlig --- src/lib/Hydra/Controller/Build.pm | 4 ---- src/root/build.tt | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 09018b5d..0ab0832e 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -108,10 +108,6 @@ sub build_GET { # If this is an aggregate build, get its constituents. $c->stash->{constituents} = [$c->stash->{build}->constituents_->search({}, {order_by => ["job"]})]; - - $c->stash->{isChannel} = $c->stash->{build}->buildproducts->search( - {type => "channel"} - )->count > 0; } diff --git a/src/root/build.tt b/src/root/build.tt index 288af542..c1f223af 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -188,7 +188,7 @@ [% IF cachedBuild; INCLUDE renderFullBuildLink build=cachedBuild; ELSE %]unknown[% END %] [% END %] - [% IF (!isAggregate || !isChannel) && build.finished; actualBuild = build.iscachedbuild ? cachedBuild : build %] + [% IF (!isAggregate || !build.isChannel) && build.finished; actualBuild = build.iscachedbuild ? cachedBuild : build %] [% IF actualBuild %] Duration: @@ -200,7 +200,7 @@ [% INCLUDE renderDateTime timestamp = build.stoptime; %] [% END %] - [% IF (!isAggregate || !isChannel) && buildLogExists(build) %] + [% IF (!isAggregate || !build.isChannel) && buildLogExists(build) %] Logfile: @@ -215,7 +215,7 @@ - [% IF isChannel || (build.buildproducts && !isAggregate) %] + [% IF build.isChannel || (build.buildproducts && !isAggregate) %]

Build products