From 7deff206226ce90b68e2e306146a1ea59c745073 Mon Sep 17 00:00:00 2001 From: E Rasche Date: Fri, 4 Aug 2017 16:17:24 +0200 Subject: [PATCH] move up to fix print statement --- scripts/grt.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/grt.py b/scripts/grt.py index 3a8978cc2e5..af0f81e899d 100644 --- a/scripts/grt.py +++ b/scripts/grt.py @@ -238,6 +238,12 @@ def main(argv): end_job_id = sa_session.query(model.Job.id) \ .order_by(model.Job.id.desc()) \ .first()[0] + + # Allow users to only report N records at once. + if args.max_records > 0: + if end_job_id - last_job_sent > args.max_records: + end_job_id = last_job_sent + args.max_records + annotate('endpoint_end', 'Processing jobs (%s, %s]' % (last_job_sent, end_job_id)) # Remember the last job sent. @@ -246,10 +252,6 @@ def main(argv): # So we can just quit now. sys.exit(0) - # Allow users to only report N records at once. - if args.max_records > 0: - if end_job_id - last_job_sent > args.max_records: - end_job_id = last_job_sent + args.max_records # Unfortunately we have to keep this mapping for the sanitizer to work properly. job_tool_map = {}