fix: reconcile and expose failed product cleanup
This commit is contained in:
@@ -1232,6 +1232,8 @@ def delete_product(request: Request, product_id: str) -> ProductRecord:
|
||||
product = _get_product_or_404(product_id)
|
||||
if product.status == "pending_cleanup":
|
||||
raise HTTPException(status_code=409, detail="product is pending cleanup")
|
||||
if product.status == "failed_cleanup":
|
||||
raise HTTPException(status_code=409, detail="product cleanup failed; restore it before deleting")
|
||||
try:
|
||||
return product_archive_store.mark_pending_cleanup(product_id, now=datetime.now(timezone.utc))
|
||||
except ValueError as exc:
|
||||
|
||||
Reference in New Issue
Block a user