@@ -76,7 +76,7 @@ our $restrictflight_cond = restrictflight_cond();
our $flightcond;
our $minflight;
-our %hcaches;
+our %cache;
sub read_existing_logs ($) {
my ($hostname) = @_;
@@ -86,8 +86,7 @@ sub read_existing_logs ($) {
return if $!==ENOENT;
die "failed to open $html_file: $!";
}
- my $tcache = { };
- $hcaches{$hostname} = $tcache;
+ %cache = ();
for (;;) {
$_ = <H> // last;
next unless m{^\<\!-- osstest-report-reuseable (.*)--\>$};
@@ -106,7 +105,7 @@ sub read_existing_logs ($) {
# print DEBUG "GOTCACHE $hostname $k\n";
}
# print DEBUG "GOTCACHE $hostname \@ $jr->{flight} $jr->{job} $jr->{status},$jr->{name}\n";
- $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}} = $jr;
+ $cache{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}} = $jr;
}
close H;
}
@@ -253,8 +252,6 @@ END
my $inrows = $hosts{$hostname};
print DEBUG "FOUND ", (scalar @$inrows), " ROWS for $hostname\n";
- my $tcache = $hcaches{$hostname};
-
# Each entry in @$inrows is a $jr, which is a hash
# It has keys for the result columns in mainquery
# It also has keys '%<letter>' (yes, with a literal '%')
@@ -267,7 +264,7 @@ END
#print DEBUG "JOB $jr->{flight}.$jr->{job} ";
my $cacherow =
- $tcache->{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}};
+ $cache{$jr->{flight},$jr->{job},$jr->{status},$jr->{name}};
if ($cacherow) {
$jr = $cacherow;
$cachehits++;
@@ -285,7 +282,7 @@ END
}
print DEBUG "CACHE $hostname $cachehits / ".(scalar @rows)
- ." of ".(scalar %$tcache)."\n";
+ ." of ".(scalar %cache)."\n";
my $write_cache_entry = sub {
my ($jr) = @_;
Now we process only one host at a time, so we don't need to distinguish. Replace all references to $tcache with %cache. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> --- sg-report-host-history | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)