浏览代码

Cache: update add_chunk to use ChunkIndex.add, fix unique count

Marian Beermann 9 年之前
父节点
当前提交
719a27d6c7
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      borg/cache.py

+ 2 - 2
borg/cache.py

@@ -378,8 +378,8 @@ Chunk index:    {0.total_unique_chunks:20d} {0.total_chunks:20d}"""
         data = self.key.encrypt(data)
         data = self.key.encrypt(data)
         csize = len(data)
         csize = len(data)
         self.repository.put(id, data, wait=False)
         self.repository.put(id, data, wait=False)
-        self.chunks[id] = ChunkIndexEntry(refcount + 1, size, csize)
-        stats.update(size, csize, True)
+        self.chunks.add(id, 1, size, csize)
+        stats.update(size, csize, not refcount)
         return ChunkListEntry(id, size, csize)
         return ChunkListEntry(id, size, csize)
 
 
     def seen_chunk(self, id, size=None):
     def seen_chunk(self, id, size=None):