mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-18 04:44:37 +00:00
Revert "docs(proxy): streaming loop comment names the 50 ms hold"
This reverts commit cbf1371873.
This commit is contained in:
parent
cbf1371873
commit
2f318eadde
1 changed files with 2 additions and 3 deletions
|
|
@ -10290,9 +10290,8 @@ async def async_data_generator(
|
|||
|
||||
loop_released_at = time.monotonic() # rebind-ok: last time this stream let other tasks run
|
||||
async for item in stream_source:
|
||||
# Unblock the event loop: a stream whose chunks are already buffered never awaits between
|
||||
# chunks, so without this one long stream holds the loop for its whole body. Yield once this
|
||||
# stream has held the loop for 50 ms (_STREAM_LOOP_HOLD_SECONDS), never on a stream that waits
|
||||
# Unblock the event loop: a stream whose chunks are already buffered never awaits
|
||||
# between chunks, so without this yield one long stream holds the loop for its whole body
|
||||
if time.monotonic() - loop_released_at >= _STREAM_LOOP_HOLD_SECONDS:
|
||||
await asyncio.sleep(0)
|
||||
loop_released_at = time.monotonic()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue