cache: don't create Item in fetch_and_build_idx

This commit is contained in:
Marian Beermann 2016-12-08 22:39:04 +01:00
parent 7e5ed40e2f
commit e169510116
1 changed files with 2 additions and 4 deletions

View File

@ -435,9 +435,7 @@ Chunk index: {0.total_unique_chunks:20d} {0.total_chunks:20d}"""
if not isinstance(item, dict): if not isinstance(item, dict):
logger.error('Error: Did not get expected metadata dict - archive corrupted!') logger.error('Error: Did not get expected metadata dict - archive corrupted!')
continue continue
item = Item(internal_dict=item) for chunk_id, size, csize in item.get(b'chunks', []):
if 'chunks' in item:
for chunk_id, size, csize in item.chunks:
chunk_idx.add(chunk_id, 1, size, csize) chunk_idx.add(chunk_id, 1, size, csize)
if self.do_cache: if self.do_cache:
fn = mkpath(archive_id) fn = mkpath(archive_id)