mirror of https://github.com/borgbackup/borg.git
Fix cache reinitalization.
This commit is contained in:
parent
d0d8dc5f1e
commit
f576c251b8
|
@ -37,17 +37,16 @@ class Cache(object):
|
||||||
def init(self):
|
def init(self):
|
||||||
"""Initializes cache by fetching and reading all archive indicies
|
"""Initializes cache by fetching and reading all archive indicies
|
||||||
"""
|
"""
|
||||||
self.summap = {}
|
|
||||||
self.chunkmap = {}
|
self.chunkmap = {}
|
||||||
self.archives = []
|
self.archives = []
|
||||||
self.tid = self.store.tid
|
self.tid = self.store.tid
|
||||||
if self.store.tid == 0:
|
if self.store.tid == 0:
|
||||||
return
|
return
|
||||||
print 'Recreating cache...'
|
print 'Recreating cache...'
|
||||||
for id in self.store.list(NS_ARCHIVES):
|
for id in list(self.store.list(NS_ARCHIVES)):
|
||||||
archive = cPickle.loads(zlib.decompress(self.store.get(NS_ARCHIVES, id)))
|
archive = cPickle.loads(zlib.decompress(self.store.get(NS_ARCHIVES, id)))
|
||||||
self.archives.append(archive['name'])
|
self.archives.append(archive['name'])
|
||||||
for id, sum, csize, osize in archive['chunks']:
|
for id, csize, osize in archive['chunks']:
|
||||||
if self.seen_chunk(id):
|
if self.seen_chunk(id):
|
||||||
self.chunk_incref(id)
|
self.chunk_incref(id)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue