From dd140842cac2a0fdc468e14e69fe3312e46fb0fa Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Wed, 18 Feb 2026 07:13:28 -0500 Subject: [PATCH] skip backfill retry when source file missing from S3 (NoSuchKey) --- make_post_sell/lib/karaoke.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/make_post_sell/lib/karaoke.py b/make_post_sell/lib/karaoke.py index 80f36e6..48702de 100644 --- a/make_post_sell/lib/karaoke.py +++ b/make_post_sell/lib/karaoke.py @@ -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: