From a411ba172dede5036f2adfdb3d6ec3afa0a6b865 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Mon, 11 Oct 2010 16:54:28 +0000 Subject: [PATCH] speed up members list, and only show latest builds less than a year old --- cgi-bin/show_members.pl | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/cgi-bin/show_members.pl b/cgi-bin/show_members.pl index d4b03b2..31b61dc 100755 --- a/cgi-bin/show_members.pl +++ b/cgi-bin/show_members.pl @@ -35,15 +35,13 @@ my $statement = < 'HEAD', branch) - branch || ':' || - extract(days from now() - snapshot) - from build_status - where name = sysname - order by branch <> 'HEAD', branch desc, - snapshot desc + select branch || ':' || + extract(days from now() - latest_snapshot) + from build_status_latest l + where l.sysname = s.name + order by branch <> 'HEAD', branch desc ) as branches - from buildsystems + from buildsystems s where status = 'approved' order by $sort_by @@ -119,7 +117,15 @@ __DATA__ Branches reported on
(most recent report) [% alt = true %] -[% FOREACH row IN statrows %] +[% FOREACH row IN statrows ; + have_recent = 0; + FOREACH branch_days IN row.branches.split(',') ; + branch_fields = branch_days.split(':'); + branch_day = branch_fields.1; + IF branch_day < 365 ; have_recent = 1; END; + END; + IF have_recent ; +%] [% alt = ! alt %] [% row.name %]
[% row.owner_email %] @@ -133,12 +139,13 @@ __DATA__ branch_fields = branch_days.split(':'); branch = branch_fields.0; branch_day = branch_fields.1; + IF branch_day < 365 ; %]
  • [% branch %] ([% branch_day %] days ago)
  • [% END %] + >[% branch %] ([% branch_day %] days ago)[% END; END %] -[% END %] +[% END; END %] -- 2.30.2