cache sync: show progress indication

sync can take quite long, so show what we are doing.
This commit is contained in:
Thomas Waldmann 2015-08-08 21:14:13 +02:00
parent cce0d20dad
commit 35b0f38f5c
1 changed files with 5 additions and 0 deletions

View File

@ -306,10 +306,15 @@ class Cache:
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()