From 04bb9688cfbac1f3f1bf76e39baf04e183badb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Trifir=C3=B2?= Date: Wed, 3 Jul 2024 00:00:43 +0200 Subject: [PATCH] grpc_server: get rid of _force_log task --- src/vllm_tgis_adapter/grpc/grpc_server.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/vllm_tgis_adapter/grpc/grpc_server.py b/src/vllm_tgis_adapter/grpc/grpc_server.py index d6f73636..5eddd364 100644 --- a/src/vllm_tgis_adapter/grpc/grpc_server.py +++ b/src/vllm_tgis_adapter/grpc/grpc_server.py @@ -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