]> xenbits.xensource.com Git - osstest.git/commitdiff
sg-report-host-history: Write cache entry for unfinished jobs
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 4 Aug 2020 15:20:49 +0000 (16:20 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 19 Aug 2020 10:41:18 +0000 (11:41 +0100)
We have to also check ->{finished}, rather than the existence of a row
at all, since now unfinished jobs can appear in the cache.

Because the cache key includes the job status, when the job becomes
finished the cache entry will be invalidated.

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

index 2ad2134d0b78f4abb1fd91edf91f0503ad8b59ef..6bf14aa2fe8f7057a400fa3d8405b589fab86cb8 100755 (executable)
@@ -214,7 +214,8 @@ END
        cache_row_lookup_prep(\$jr);
 
        my $endedrow = cacheable_query($endedq, $jr, 'e');
-       if (!$endedrow) {
+       if (!defined $endedrow->{finished}) {
+           cache_write_entry(\*H, $jr);
            #print DEBUG "no-finished\n";
            next;
        }