compact: fix cleaning archives directory

- catch correct exception: ObjectNotFound
- use logger.warning, improve error msg
This commit is contained in:
Thomas Waldmann 2025-06-16 23:14:10 +02:00
parent ba7dbd52f4
commit 4359c41d9b
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -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...")