Skip to content

Commit

Permalink
cache sync: show progress indication
Browse files Browse the repository at this point in the history
sync can take quite long, so show what we are doing.
  • Loading branch information
ThomasWaldmann committed Aug 8, 2015
1 parent 27d64a2 commit 149dd0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions borg/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,15 @@ def create_master_idx(chunk_idx, tf_in, tmp_dir):
chunk_idx.clear()
for tarinfo in tf_in:
archive_id_hex = tarinfo.name
archive_name = tarinfo.pax_headers['archive_name']
print("- processing archive: %s -> extract, " % archive_name, end='') ; sys.stdout.flush()
tf_in.extract(archive_id_hex, tmp_dir)
chunk_idx_path = os.path.join(tmp_dir, archive_id_hex).encode('utf-8')
print("read, ", end='') ; sys.stdout.flush()
archive_chunk_idx = ChunkIndex.read(chunk_idx_path)
print("merge, ", end='') ; sys.stdout.flush()
chunk_idx.merge(archive_chunk_idx)
print("done.")
os.unlink(chunk_idx_path)

self.begin_txn()
Expand Down

0 comments on commit 149dd0d

Please sign in to comment.