fix: mock

This commit is contained in:
2026-03-13 23:29:55 +08:00
parent b7e973e2b6
commit c72fbc9a14
7 changed files with 165 additions and 21 deletions

View File

@@ -28,6 +28,9 @@ async def process_images_ocr_batch_async(image_ids: list[str], max_concurrency:
"""Process many images with bounded OCR concurrency."""
if not image_ids:
return
# De-duplicate in-memory to prevent repeated processing of same image id
# in a single batch submission.
image_ids = list(dict.fromkeys(image_ids))
concurrency = max(1, max_concurrency)
semaphore = asyncio.Semaphore(concurrency)