diff options
Diffstat (limited to 'tools/merge_backup.py')
-rwxr-xr-x | tools/merge_backup.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/merge_backup.py b/tools/merge_backup.py index 6834e52..123347a 100755 --- a/tools/merge_backup.py +++ b/tools/merge_backup.py @@ -12,7 +12,7 @@ from certtools import timing_point, build_merkle_tree, write_file, \ create_ssl_context from mergetools import chunks, backup_sendlog, get_logorder, \ get_verifiedsize, get_missingentriesforbackup, read_chain, \ - hexencode, setverifiedsize, sendentry_merge, verifyroot, \ + hexencode, setverifiedsize, sendentries_merge, verifyroot, \ get_nfetched, parse_args def merge_backup(args, config, localconfig, secondaries): @@ -84,12 +84,12 @@ def merge_backup(args, config, localconfig, secondaries): fetched_entries = 0 print >>sys.stderr, "fetching missing entries", sys.stderr.flush() - for missingentry in missingentries: - ehash = base64.b64decode(missingentry) - sendentryresult = sendentry_merge(nodename, nodeaddress, - own_key, paths, - read_chain(chainsdir, ehash), - ehash) + for missingentry_chunk in chunks(missingentries, 100): + missingentry_hashes = [base64.b64decode(missingentry) for missingentry in missingentry_chunk] + hashes_and_entries = [(hash, read_chain(chainsdir, hash)) for hash in missingentry_hashes] + sendentryresult = sendentries_merge(nodename, nodeaddress, + own_key, paths, + hashes_and_entries) if sendentryresult["result"] != "ok": print >>sys.stderr, "sendentry_merge:", sendentryresult sys.exit(1) |