Update suggested changes for qsize check

This commit is contained in:
Xiaochen Zheng 2025-03-27 23:09:50 +01:00
parent 6d766307be
commit ee687e25d6

View File

@ -1049,7 +1049,9 @@ async def main():
# Initialize the work queue
qsize = await work_queue.initialize_queue()
if qsize > 0:
if qsize == 0:
logger.info("No work to do, exiting")
return
# Create a semaphore to control worker access
# We only allow one worker to move forward with requests, until the server has no more requests in its queue
# This lets us get full utilization by having many workers, but also to be outputting dolma docs as soon as possible
@ -1077,8 +1079,6 @@ async def main():
sglang_server.cancel()
metrics_task.cancel()
logger.info("Work done")
else:
logger.info("No work to do, exiting")
if __name__ == "__main__":