From 2974795971aa609cee41937ceed2cd9bcccfbd6d Mon Sep 17 00:00:00 2001 From: "S. ElSayed" <s.elsayed@fz-juelich.de> Date: Thu, 11 Nov 2021 20:28:07 +0100 Subject: [PATCH] Minor changes to consumer --- unittests/consumer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/unittests/consumer.py b/unittests/consumer.py index c31386a..b66589f 100644 --- a/unittests/consumer.py +++ b/unittests/consumer.py @@ -30,20 +30,21 @@ if serv.init(args["address"]) == -1: # serv_nextobjs count = 0 per_req = math.ceil(args["objects"] / args["requests"]) +sleep_time = 3 while count < args["objects"]: obj_list = serv.nextobjs(per_req) if ( isinstance(obj_list, list)): - count = count+obj_list.size() + count = count+len(obj_list) logging.info("New list of objects:") for obj in obj_list: logging.info(obj) elif obj_list == 0: - sleep_time = 3 logging.info("Waiting for %ds on more objects, current count = %d" % (sleep_time, count)) time.sleep(sleep_time) else: - logging.info("An error occurred while getting objects, final count = %d" % (count)) - break + logging.info("An error occurred while getting objects, final count = %d, waiting" % (count)) + time.sleep(sleep_time) + logging.info("Total objects read = %d" % (count)) serv.fini() -- GitLab