mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
Merge pull request #3741 from BerriAI/litellm_fix_check_request_disconnection_loic
[Fix] only run `check_request_disconnection` logic for maximum 10 mins
This commit is contained in:
commit
55c3e41f4d
1 changed files with 4 additions and 1 deletions
|
|
@ -429,7 +429,10 @@ async def check_request_disconnection(request: Request, llm_api_call_task):
|
|||
Returns:
|
||||
- None
|
||||
"""
|
||||
while True:
|
||||
|
||||
# only run this function for 10 mins -> if these don't get cancelled -> we don't want the server to have many while loops
|
||||
start_time = time.time()
|
||||
while time.time() - start_time < 600:
|
||||
await asyncio.sleep(1)
|
||||
if await request.is_disconnected():
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue