mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
Merge pull request #8792 from ThomasWaldmann/fix-compact
compact: always write updated chunkindex to repo, fixes #8791
This commit is contained in:
commit
622b42aefa
1 changed files with 5 additions and 8 deletions
|
|
@ -61,14 +61,11 @@ class ArchiveGarbageCollector:
|
|||
return chunks
|
||||
|
||||
def save_chunk_index(self):
|
||||
if self.stats:
|
||||
# write_chunkindex_to_repo now removes all flags and size infos.
|
||||
# we need this, as we put the wrong size in there to support --stats computations.
|
||||
write_chunkindex_to_repo_cache(
|
||||
self.repository, self.chunks, clear=True, force_write=True, delete_other=True
|
||||
)
|
||||
else:
|
||||
self.chunks.clear() # we already have updated the repo cache in get_repository_chunks
|
||||
# as we may have deleted some chunks, we must write a full updated chunkindex to the repo
|
||||
# and also remove all older cached chunk indexes.
|
||||
# write_chunkindex_to_repo now removes all flags and size infos.
|
||||
# we need this, as we put the wrong size in there to support --stats computations.
|
||||
write_chunkindex_to_repo_cache(self.repository, self.chunks, clear=True, force_write=True, delete_other=True)
|
||||
self.chunks = None # nothing there (cleared!)
|
||||
|
||||
def analyze_archives(self) -> Tuple[Set, int, int, int]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue