[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 32/60] sg-report-job-history: Prep for fork: Move $revisionsq query


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:37 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:27:25 +0000
  • Ironport-sdr: VZVhd9rwqwtWKEI/K/ZXRLl7EVsrakjNSOWIcBpLpsx/jCDOZkn0BqdG8WFs+zCFYIBTlTukA0 h7juCpDFUL/KX80J/DYcnhygLz85c0/ADnz8CNAp8ChooR4IyJhyPmgMPJqOiTSZeKlFGSxJoF oXoFf7hvZCFGbhzB9JwWvN4H/e2+8KJA9HOa9emrMyZqkcoNxmvH25IUeNJrJiyv22nIZCGX35 vQVmyQT2Vis+KM7uYz8clDy31YmfNHWZrKS9QQWQcFoEDnJkUxZ/d8/Kyx8FhoRGLzOhTCxuj6 ARY=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

We will need to prepare this in add_revisions so that it works when we
do each (job,branch) in a different process.

It is OK that it is still global, becauswe we only call add_revisions
in the children.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-job-history | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sg-report-job-history b/sg-report-job-history
index 47fc7a62..424053f1 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -89,15 +89,16 @@ if (defined($flight)) {
     push @jobs, $job;
 }
 
-our $revisionsq= db_prepare(<<END);
+sub add_revisions ($$$$) {
+    my ($revmap, $flightnum, $j, $sfx) = @_;
+
+    our $revisionsq //= db_prepare(<<END);
         SELECT * FROM runvars
          WHERE flight=? AND job=?
            AND name LIKE 'built\\_revision\\_%'
 END
-# (We report on non-main-revision jobs just as for main-revision ones.)
+    # (We report on non-main-revision jobs just as for main-revision ones.)
 
-sub add_revisions ($$$$) {
-    my ($revmap, $flightnum, $j, $sfx) = @_;
     $revisionsq->execute($flightnum, $j);
     while (my $row= $revisionsq->fetchrow_hashref()) {
         my $n= $row->{name};
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.