skip backfill retry when source file missing from S3 (NoSuchKey)

This commit is contained in:
russell@unturf.com 2026-02-18 07:13:28 -05:00
parent 015121b600
commit dd140842ca

View file

@ -232,7 +232,11 @@ def backfill_karaoke_async(shop_id, session_factory, app_settings):
)
if sizes:
return product_id, title, file_key, ext, media_type, sizes
except Exception:
except Exception as exc:
# Don't retry if the source file doesn't exist in S3
if "NoSuchKey" in str(type(exc).__name__) or "NoSuchKey" in str(exc):
log.warning(" SKIP %s (%s) — source file not in S3", title, file_key)
return product_id, title, file_key, ext, media_type, None
log.exception("Backfill attempt %d failed for %s", attempt + 1, title)
if attempt < MAX_RETRIES - 1: