MCPcopy Index your code
hub / github.com/borgbackup/borg / process_file_chunks

Method process_file_chunks

src/borg/archive.py:1209–1225  ·  view source on GitHub ↗
(self, item, cache, stats, show_progress, chunk_iter, chunk_processor=None)

Source from the content-addressed store, hash-verified

1207 self.rechunkify = rechunkify
1208
1209 def process_file_chunks(self, item, cache, stats, show_progress, chunk_iter, chunk_processor=None):
1210 if not chunk_processor:
1211
1212 def chunk_processor(chunk):
1213 started_hashing = time.monotonic()
1214 chunk_id, data = cached_hash(chunk, self.key.id_hash)
1215 stats.hashing_time += time.monotonic() - started_hashing
1216 chunk_entry = cache.add_chunk(chunk_id, {}, data, stats=stats, wait=False, ro_type=ROBJ_FILE_STREAM)
1217 self.cache.repository.async_response(wait=False)
1218 return chunk_entry
1219
1220 item.chunks = []
1221 for chunk in chunk_iter:
1222 chunk_entry = chunk_processor(chunk)
1223 item.chunks.append(chunk_entry)
1224 if show_progress:
1225 stats.show_progress(item=item, dt=0.2)
1226
1227
1228def maybe_exclude_by_attr(item):

Callers 4

process_pipeMethod · 0.80
process_fileMethod · 0.80
process_fileMethod · 0.80
process_chunksMethod · 0.80

Calls 1

show_progressMethod · 0.80

Tested by

no test coverage detected