فهرست منبع

compact: fix cleaning archives directory

- catch correct exception: ObjectNotFound
- use logger.warning, improve error msg
Thomas Waldmann 4 روز پیش
والد
کامیت
4359c41d9b
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  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)
             try:
                 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
         logger.info("Determining unused objects...")