diff --git a/lib/metasync b/lib/metasync index ee48497..74c1a99 100755 --- a/lib/metasync +++ b/lib/metasync @@ -361,18 +361,16 @@ def apply_action(action): actions.sort(key=lambda x: (x[0] == DELETE, len(x[1]))) if args.verbose: print 'Actions:' -for action in actions: +for batch in batch_generator(actions, 100): + for action in batch: + if args.verbose: + print_action(action) + if not args.fake: + apply_action(action) + else: + print 'Fake, doing nothing' if args.verbose: - print_action(action) - if not args.fake: - apply_action(action) - else: - print 'Fake, doing nothing' - -if args.verbose: - print 'Waiting for completion..', -i = len(actions) -while i: - lconn.result() - i -= 1 -print ' done' + print 'Waiting for completion..', + for action in batch: + lconn.result() + print ' done'