fix: quarantine failed product cleanups in failed_cleanup state
This commit is contained in:
@@ -126,7 +126,9 @@ class CleanupService:
|
||||
if product_dir.exists():
|
||||
shutil.rmtree(product_dir)
|
||||
except Exception:
|
||||
self.product_store.release_product_purge(product.product_id)
|
||||
# rmtree may have removed only part of the archive. Quarantine
|
||||
# the record for manual inspection instead of retrying it.
|
||||
self.product_store.fail_product_purge(product.product_id)
|
||||
raise
|
||||
self.product_store.finalize_product_purge(product.product_id, now=now_utc)
|
||||
report.deleted_product_ids.append(product.product_id)
|
||||
|
||||
Reference in New Issue
Block a user