(self, item, cache, stats, show_progress, chunk_iter, chunk_processor=None)
| 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 | |
| 1228 | def maybe_exclude_by_attr(item): |
no test coverage detected