diff mbox series

[OSSTEST,06/13] sg-report-host-history: Add $cachekey argument to jobquery

Message ID 20191108185001.3319-7-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Speed up and restore host history | expand

Commit Message

Ian Jackson Nov. 8, 2019, 6:49 p.m. UTC
This key will distinguish the results of different queries we do per
job.  Right now it is not used, so no functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 sg-report-host-history | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/sg-report-host-history b/sg-report-host-history
index 81a7a8d8..4c40cbec 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -109,7 +109,8 @@  END
     print DEBUG "MINFLIGHT $minflight\n";
 }
 
-sub jobquery ($$) {
+sub jobquery ($$$) {
+    my ($q, $jr, $cachekey) = @_;
     my ($q, $jr) = @_;
     $q->execute($jr->{flight}, $jr->{job});
     return $q->fetchrow_hashref();
@@ -218,7 +219,7 @@  END
     foreach my $jr (@$inrows) {
 	print DEBUG "JOB $jr->{flight}.$jr->{job} ";
 
-	my $endedrow = jobquery($endedq, $jr);
+	my $endedrow = jobquery($endedq, $jr, 'e');
 	if (!$endedrow) {
 	    print DEBUG "no-finished\n";
 	    next;
@@ -235,8 +236,8 @@  END
     my $alternate = 0;
     foreach my $jr (@rows) {
         print DEBUG "JR $jr->{flight}.$jr->{job}\n";
-	my $ir = jobquery($infoq, $jr);
-	my $ar = jobquery($allocdq, $jr);
+	my $ir = jobquery($infoq, $jr, 'i');
+	my $ar = jobquery($allocdq, $jr, 'a');
 	my $ident = $jr->{name};
 	$jrunvarq->execute($jr->{flight}, $jr->{job}, $ident);
         my %runvars;