浏览代码

cache sync: show progress indication

sync can take quite long, so show what we are doing.
Thomas Waldmann 9 年之前
父节点
当前提交
35b0f38f5c
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      borg/cache.py

+ 5 - 0
borg/cache.py

@@ -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()