Only sleep if there is more work to be done

(imported from commit f8a1380e0045c9470909c088a9d262f8a714c86e)
This commit is contained in:
Leo Franchi
2013-03-18 13:09:16 -04:00
parent 6d6c3364dc
commit c6f9dbdd54

View File

@@ -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)