metasync: send actions by batch of size 100
This commit is contained in:
parent
a4c68afbaa
commit
801d0d7c75
26
lib/metasync
26
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'
|
||||
|
|
Reference in New Issue