]> xenbits.xensource.com Git - osstest.git/commitdiff
history reporting (nfc): Break out cache_row_lookup_prep
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 4 Aug 2020 17:03:49 +0000 (18:03 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 19 Aug 2020 10:41:18 +0000 (11:41 +0100)
Prep work.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
sg-report-host-history

index a8dae15918c9afeec4ad08b135d4bb502d1fdac0..2724ef277118d2963a07d7ad44407a583f2419d9 100755 (executable)
@@ -112,6 +112,16 @@ sub cache_read_existing ($) {
     close H;
 }
 
+sub cache_row_lookup_prep ($) {
+    my ($jrr) = @_;
+
+    my $cacherow = $cache{cache_row_key($$jrr)};
+    if ($cacherow) {
+       $$jrr = $cacherow;
+       $cachehits++;
+    }
+}
+
 sub cache_write_entry ($$) {
     my ($fh, $jr) = @_;
     print $fh "<!-- osstest-report-reuseable";
@@ -286,11 +296,7 @@ END
     foreach my $jr (@$inrows) {
        #print DEBUG "JOB $jr->{flight}.$jr->{job} ";
 
-       my $cacherow = $cache{cache_row_key($jr)};
-       if ($cacherow) {
-           $jr = $cacherow;
-           $cachehits++;
-       }
+       cache_row_lookup_prep(\$jr);
 
        my $endedrow = cacheable_query($endedq, $jr, 'e');
        if (!$endedrow) {