Mailing List Archive

[OSSTEST PATCH v2 28/41] sg-report-host-history: Rerganisation: Change loops
Move the per-host code all into the same per-host loop. One effect is
to transpose the db_retry and host loops for mainquery.

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
sg-report-host-history | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/sg-report-host-history b/sg-report-host-history
index 3f4670e5..2ca0e235 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -470,18 +470,10 @@ db_retry($dbh_tests, [], sub {
computeflightsrange();
});

-foreach (keys %hosts) {
- read_existing_logs($_);
-}
-
-db_retry($dbh_tests, [], sub {
- foreach my $host (sort keys %hosts) {
- mainquery($host);
- }
-});
-
foreach my $host (sort keys %hosts) {
+ read_existing_logs($host);
db_retry($dbh_tests, [], sub {
+ mainquery($host);
reporthost $host;
});
}
--
2.20.1