Browse Source

Merge pull request #8929 from ThomasWaldmann/issue-8928

compact: fix cleaning archives directory
TW 3 days ago
parent
commit
963fc6b869
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/borg/archiver/compact_cmd.py

+ 2 - 2
src/borg/archiver/compact_cmd.py

@@ -166,8 +166,8 @@ class ArchiveGarbageCollector:
             name, id, hex_id = archive_info.name, archive_info.id, bin_to_hex(archive_info.id)
             name, id, hex_id = archive_info.name, archive_info.id, bin_to_hex(archive_info.id)
             try:
             try:
                 self.manifest.archives.nuke_by_id(id)
                 self.manifest.archives.nuke_by_id(id)
-            except KeyError:
-                self.print_warning(f"Archive {name} {hex_id} not found.")
+            except self.repository.ObjectNotFound:
+                logger.warning(f"Soft-deleted archive {name} {hex_id} not found.")
 
 
         repo_size_before = self.repository_size
         repo_size_before = self.repository_size
         logger.info("Determining unused objects...")
         logger.info("Determining unused objects...")