diff mbox series

[OSSTEST,31/60] sg-report-job-history: Prep for fork: Move $buildsq query

Message ID 20200814172205.9624-32-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Speed up sg-report-job-history | expand

Commit Message

Ian Jackson Aug. 14, 2020, 5:21 p.m. UTC
We will need to prepare this once per (job,branch) so that it works
when we do each of those in a different process.

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

Patch

diff --git a/sg-report-job-history b/sg-report-job-history
index 6008ca72..47fc7a62 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -106,15 +106,15 @@  sub add_revisions ($$$$) {
     }
 }
 
-our $buildsq= db_prepare(<<END);
+sub processjobbranch ($$) {
+    my ($j,$bra) = @_;
+
+    my $buildsq= db_prepare(<<END);
         SELECT * FROM runvars
          WHERE flight=? AND job=?
            AND name LIKE '%buildjob'
 END
 
-sub processjobbranch ($$) {
-    my ($j,$bra) = @_;
-
     print DEBUG "processjobbranch('$j',", ($bra ? "'$bra'" : 'undef'), ")\n";
 
     my %rev_grid_col;