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

Method seen_chunk

src/borg/cache.py:866–877  ·  view source on GitHub ↗
(self, id, size=None)

Source from the content-addressed store, hash-verified

864 return self._chunks
865
866 def seen_chunk(self, id, size=None):
867 entry = self.chunks.get(id)
868 entry_exists = entry is not None
869 if entry_exists and size is not None:
870 if entry.size == 0:
871 # AdHocWithFilesCache:
872 # Here *size* is used to update the chunk's size information, which will be zero for existing chunks.
873 self.chunks[id] = entry._replace(size=size)
874 else:
875 # in case we already have a size information in the entry, check consistency:
876 assert size == entry.size
877 return entry_exists
878
879 def reuse_chunk(self, id, size, stats):
880 assert isinstance(size, int) and size > 0

Callers 4

add_chunkMethod · 0.95
process_fileMethod · 0.80
transfer_chunksFunction · 0.80

Calls 1

getMethod · 0.45

Tested by 1