MCPcopy Create free account
hub / github.com/PaddlePaddle/FastDeploy / connection_manager

Function connection_manager

fastdeploy/entrypoints/openai/api_server.py:316–327  ·  view source on GitHub ↗

async context manager for connection manager

()

Source from the content-addressed store, hash-verified

314
315@asynccontextmanager
316async def connection_manager():
317 """
318 async context manager for connection manager
319 """
320 try:
321 await asyncio.wait_for(connection_semaphore.acquire(), timeout=0.001)
322 yield
323 except asyncio.TimeoutError:
324 api_server_logger.info(f"Reach max request concurrency, semaphore status: {connection_semaphore.status()}")
325 raise HTTPException(
326 status_code=429, detail=f"Too many requests,current max concurrency is {args.max_concurrency}"
327 )
328
329
330# TODO 传递真实引擎值 通过pid 获取状态

Callers 2

create_chat_completionFunction · 0.85
create_completionFunction · 0.85

Calls 3

acquireMethod · 0.45
infoMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected