We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
_force_log
1 parent 344a5d0 commit 808632dCopy full SHA for 808632d
vllm/entrypoints/openai/api_server.py
@@ -4,6 +4,7 @@
4
import re
5
from contextlib import asynccontextmanager
6
from http import HTTPStatus
7
+from typing import Any, Set
8
9
import fastapi
10
import uvicorn
@@ -33,6 +34,8 @@
33
34
openai_serving_completion: OpenAIServingCompletion
35
logger = init_logger(__name__)
36
37
+_running_tasks: Set[asyncio.Task[Any]] = set()
38
+
39
40
@asynccontextmanager
41
async def lifespan(app: fastapi.FastAPI):
@@ -43,7 +46,9 @@ async def _force_log():
43
46
await engine.do_log_stats()
44
47
45
48
if not engine_args.disable_log_stats:
- asyncio.create_task(_force_log())
49
+ task = asyncio.create_task(_force_log())
50
+ _running_tasks.add(task)
51
+ task.add_done_callback(_running_tasks.remove)
52
53
yield
54
0 commit comments