fix: image parser concurrency error

This commit is contained in:
wizardchen
2025-09-10 13:19:39 +08:00
committed by lyingbug
parent fd6c50059e
commit 0e1d7edca3
+1 -9
View File
@@ -1042,14 +1042,6 @@ class BaseParser(ABC):
Returns:
Processed Chunk object
"""
# Set request ID context in the asynchronous task
try:
if current_request_id:
from utils.request import set_request_id
set_request_id(current_request_id)
logger.info(f"Chunk processing task #{chunk_idx+1} setting request ID: {current_request_id}")
except Exception as e:
logger.warning(f"Failed to set request ID in Chunk processing task: {str(e)}")
logger.info(f"Starting to process images in Chunk #{chunk_idx+1}/{total_chunks}")
@@ -1146,7 +1138,7 @@ class BaseParser(ABC):
# Create and run all Chunk concurrent processing tasks
async def process_all_chunks():
# Set max concurrency, reduce concurrency to avoid resource contention
max_concurrency = min(self.max_concurrent_tasks, 5) # Reduce concurrency
max_concurrency = min(self.max_concurrent_tasks, 1) # Reduce concurrency
# Use semaphore to limit concurrency
semaphore = asyncio.Semaphore(max_concurrency)