Skip to content

Commit b5ff91a

Browse files
committed
update
1 parent 8eb7f19 commit b5ff91a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/litserve/loops/continuous_batching_loop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ async def run_in_background(
157157
try:
158158
pending_requests = []
159159
while True:
160-
await asyncio.sleep(0.001)
161160
pending_requests = await self.prefill(
162161
pending_requests,
163162
lit_api,
@@ -167,6 +166,7 @@ async def run_in_background(
167166
batch_timeout,
168167
response_queues,
169168
)
169+
await asyncio.sleep(0)
170170
except Exception as e:
171171
logger.exception("An error occurred in run_in_background: %s", e)
172172
finally:
@@ -194,7 +194,7 @@ async def run(
194194
"""Main loop that processes batches of requests."""
195195
try:
196196
prev_outputs = None
197-
while await lit_api.has_active_requests():
197+
while lit_api.has_active_requests():
198198
# Process one step for all active sequences
199199
responses = await self.step(prev_outputs, lit_api, lit_spec)
200200
if len(responses) == 0:

src/litserve/loops/loops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ async def _wrapper():
476476
workers_setup_status,
477477
callback_runner,
478478
)
479-
await asyncio.sleep(0.00001)
479+
await asyncio.sleep(0)
480480
except Exception as e:
481481
logger.exception("An error occurred in the loop: %s", e)
482482
# Optionally, break the loop or handle the error as needed

0 commit comments

Comments
 (0)