Fix cache reinitalization.

This commit is contained in:
Jonas Borgström 2010-10-15 19:33:15 +02:00
parent d0d8dc5f1e
commit f576c251b8
1 changed files with 2 additions and 3 deletions

View File

@ -37,17 +37,16 @@ class Cache(object):
def init(self):
"""Initializes cache by fetching and reading all archive indicies
"""
self.summap = {}
self.chunkmap = {}
self.archives = []
self.tid = self.store.tid
if self.store.tid == 0:
return
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)))
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):
self.chunk_incref(id)
else: