From c6f9dbdd541afee6b43f033fa422746958894baf Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Mon, 18 Mar 2013 13:09:16 -0400 Subject: [PATCH] Only sleep if there is more work to be done (imported from commit f8a1380e0045c9470909c088a9d262f8a714c86e) --- zephyr/lib/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zephyr/lib/utils.py b/zephyr/lib/utils.py index d3ba9c2399..87ca508b1b 100644 --- a/zephyr/lib/utils.py +++ b/zephyr/lib/utils.py @@ -18,4 +18,6 @@ def run_in_batches(all_list, batch_size, callback, sleep_time = 0, logger = None logger("Executing %s in batch %s of %s" % (end-start, i+1, limit)) callback(batch) - sleep(sleep_time) + + if i != limit - 1: + sleep(sleep_time)