[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [OSSTEST PATCH 52/60] sg-report-job-history: Cache the per-flight revisions
This involves changing %revisions to %$revisions in the code which uses the value. No logical change. Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- sg-report-job-history | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sg-report-job-history b/sg-report-job-history index 9f1216a6..39ebe024 100755 --- a/sg-report-job-history +++ b/sg-report-job-history @@ -172,25 +172,29 @@ END \%hosts; }); - my %revisions; - add_revisions(\%revisions, $f->{flight}, $f->{job}, ''); + my $revisions = cacheable_fn($f, 'r', sub { + my %revisions; + add_revisions(\%revisions, $f->{flight}, $f->{job}, ''); - $buildsq->execute($f->{flight}, $f->{job}); - while (my $bld= $buildsq->fetchrow_hashref()) { - my $bn= $bld->{name}; - $bn =~ s/buildjob$//; - my ($oflight,$ojob) = flight_otherjob($f->{flight}, $bld->{val}); - add_revisions(\%revisions, $oflight, $ojob, " ($bn)"); - } + $buildsq->execute($f->{flight}, $f->{job}); + while (my $bld= $buildsq->fetchrow_hashref()) { + my $bn= $bld->{name}; + $bn =~ s/buildjob$//; + my ($oflight,$ojob) = + flight_otherjob($f->{flight}, $bld->{val}); + add_revisions(\%revisions, $oflight, $ojob, " ($bn)"); + } + \%revisions; + }); my @rev_cols; - foreach my $revk (sort keys %revisions) { + foreach my $revk (sort keys %$revisions) { my $col= $rev_grid_col{$revk}; if (!defined $col) { $col= @rev_grid_cols; push @rev_grid_cols, $revk; $rev_grid_col{$revk}= $col; } - $rev_cols[$col]= $revisions{$revk}; + $rev_cols[$col]= $$revisions{$revk}; } $ri->{Revisions}= \@rev_cols; $ri->{Flight}= $f; -- 2.11.0
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |