Skip to content

Commit

Permalink
grpc_server: get rid of _force_log task
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrifiro committed Jul 3, 2024
1 parent 0700022 commit 04bb968
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/vllm_tgis_adapter/grpc/grpc_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,21 +922,15 @@ async def run_grpc_server(
*,
disable_log_stats: bool,
) -> None:
async def _force_log() -> None:
while True:
await asyncio.sleep(10)
await engine.do_log_stats()

if not disable_log_stats:
asyncio.create_task(_force_log()) # noqa: RUF006

assert args is not None

server = await start_grpc_server(engine, args)

try:
while True:
await asyncio.sleep(60)
await asyncio.sleep(10)
if not disable_log_stats:
await engine.do_log_stats()
except asyncio.CancelledError:
print("Gracefully stopping gRPC server") # noqa: T201
await server.stop(30) # TODO configurable grace
Expand Down

0 comments on commit 04bb968

Please sign in to comment.