mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
only run check_request_disconnection logic for 10 mins
This commit is contained in:
parent
df4e6b6576
commit
44c998293d
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
Add a link
Reference in a new issue