From e1abca4a66423fdb5bcf1f438beab96e61d59d22 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Wed, 18 Feb 2026 19:16:22 -0500 Subject: [PATCH] throttle backfill to 1 worker, increase stderr log to 2000 chars 4 concurrent workers was overwhelming the unsandbox API (429/502). Cap at 1 worker for now. Also increase stderr truncation from 500 to 2000 chars to see full ffmpeg errors. --- make_post_sell/lib/karaoke.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make_post_sell/lib/karaoke.py b/make_post_sell/lib/karaoke.py index a85233e..9c07062 100644 --- a/make_post_sell/lib/karaoke.py +++ b/make_post_sell/lib/karaoke.py @@ -102,7 +102,7 @@ def process_karaoke(s3_client, bucket, s3_key, s3_path, return None if not result.get("success") or result.get("exit_code") != 0: - log.warning("Unsandbox execute non-zero exit: success=%s exit_code=%s stdout=%.500s stderr=%.500s", + log.warning("Unsandbox execute non-zero exit: success=%s exit_code=%s stdout=%.2000s stderr=%.2000s", result.get("success"), result.get("exit_code"), result.get("stdout", ""), result.get("stderr", "")) return None @@ -234,7 +234,7 @@ def backfill_karaoke_async(shop_id, session_factory, app_settings): # Query account concurrency from unsandbox API — abort if keys are bad try: key_info = validate_keys(pk, sk) - concurrency = max(1, int(key_info.get("concurrency", 1))) + concurrency = min(1, max(1, int(key_info.get("concurrency", 1)))) except Exception as e: log.error("Backfill aborted — unsandbox keys invalid or expired for shop %s: %s", shop.name, e) return