From 17a0ada61fc0a30537c4e17e2092bf5c70bacda0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 10 Aug 2020 17:32:58 +0100 Subject: [PATCH] sg-report-job-history: Provide --time-limit Calculate a minflight based on the time limit, and set the time limit to a year ago by default. Signed-off-by: Ian Jackson --- sg-report-job-history | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sg-report-job-history b/sg-report-job-history index 5d2a7e1..e09c694 100755 --- a/sg-report-job-history +++ b/sg-report-job-history @@ -30,6 +30,7 @@ use Osstest::HistoryReport; our (@blessings,@branches); our $limit= 100; +our $timelimit= 86400 * (366 + 14); our $htmlout = '.'; our $flight; our $maxjobs=10; @@ -44,6 +45,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) { $$1= $2; } elsif (m/^--(limit)\=([1-9]\d*)$/) { $$1= $2; + } elsif (m/^--time-limit\=([1-9]\d*)$/) { + $timelimit= $1; } elsif (restrictflight_arg($_)) { # Handled by Executive } elsif (m/^--html-dir=(.*)$/) { @@ -67,6 +70,9 @@ csreadconfig(); our @jobs; +our $minflight = minflight_by_time($timelimit); +print DEBUG "MINFLIGHT $minflight\n"; + sub findflight () { my $branches= $dbh_tests->selectcol_arrayref(< $minflight ORDER BY flight DESC LIMIT $limit END -- 2.39.5