skip backfill retry when source file missing from S3 (NoSuchKey)
This commit is contained in:
parent
015121b600
commit
dd140842ca
1 changed files with 5 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue