From 7e620f39f19157762388d80eb5a211a38deea96e Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Wed, 18 Feb 2026 19:46:28 -0500 Subject: [PATCH] uncap concurrency, skip per-item validate_keys in backfill --- make_post_sell/lib/karaoke.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/make_post_sell/lib/karaoke.py b/make_post_sell/lib/karaoke.py index 431ae5d..80368a2 100644 --- a/make_post_sell/lib/karaoke.py +++ b/make_post_sell/lib/karaoke.py @@ -23,7 +23,8 @@ VOXSPLIT_SOURCE = os.environ.get( def process_karaoke(s3_client, bucket, s3_key, s3_path, - is_video, extension, public_key=None, secret_key=None): + is_video, extension, public_key=None, secret_key=None, + skip_validate=False): """Download from S3 -> process in unsandbox zerotrust -> upload both tracks. Produces two files under s3_path: @@ -34,12 +35,12 @@ def process_karaoke(s3_client, bucket, s3_key, s3_path, """ public_key, secret_key = _resolve_credentials(public_key, secret_key) - # Validate keys are still active before spending time on S3 download - try: - validate_keys(public_key, secret_key) - except Exception as e: - log.warning("Unsandbox API keys invalid or expired — skipping: %s", e) - return None + if not skip_validate: + try: + validate_keys(public_key, secret_key) + except Exception as e: + log.warning("Unsandbox API keys invalid or expired — skipping: %s", e) + return None log.info("process_karaoke: bucket=%s key=%s s3_path=%s", bucket, s3_key, s3_path) @@ -234,7 +235,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 = min(2, max(1, int(key_info.get("concurrency", 1)))) + concurrency = 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 @@ -283,6 +284,7 @@ def backfill_karaoke_async(shop_id, session_factory, app_settings): f"{s3_path}/{file_key}", s3_path, is_video, ext, public_key=pk, secret_key=sk, + skip_validate=True, ) if sizes: return product_id, title, file_key, ext, media_type, sizes