diff mbox series

[OSSTEST,15/60] history reporting (nfc): Introduce cache_set_key_cols

Message ID 20200814172205.9624-16-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
This setter function will be needed when this becomes its own module.

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

Patch

diff --git a/sg-report-host-history b/sg-report-host-history
index 9510757f..07e549a0 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -76,12 +76,14 @@  our $restrictflight_cond = restrictflight_cond();
 our $flightcond;
 our $minflight;
 
+our @cache_row_key_cols;
+
 our %cache;
 
 our %q_count;
 our %q_misses;
 
-our @cache_row_key_cols = qw(flight job status name);
+sub cache_set_key_cols { @cache_row_key_cols = @_; }
 
 sub cache_row_key ($) {
     my ($jr) = @_;
@@ -177,6 +179,8 @@  sub cache_write_entry ($$) {
     print $fh " -->\n";
 }
 
+cache_set_key_cols(qw(flight job status name));
+
 sub computeflightsrange () {
     if ($flightlimit) {
 	my $minflightsq = db_prepare(<<END);