mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-11 12:38:02 +00:00
fix: Fix lifespan app handler not working
It was noticed that shutdown handlers for implementations are not executed. Investigation reveals that lifespan logic is not working. When server starts, we see: ``` ASGI 'lifespan' protocol appears unsupported. ``` This is because uvicorn calls to app with a missing path on startup, (perhaps to detect that the protocol is working?) and our TracingMiddleware was not ready for that, resulting in an exception and lifespan logic disabled. Fixes #188 Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
This commit is contained in:
parent
e4acdf6d54
commit
056eb68fcc
1 changed files with 1 additions and 1 deletions
|
@ -215,7 +215,7 @@ class TracingMiddleware:
|
|||
self.app = app
|
||||
|
||||
async def __call__(self, scope, receive, send):
|
||||
path = scope["path"]
|
||||
path = scope.get("path", "")
|
||||
await start_trace(path, {"__location__": "server"})
|
||||
try:
|
||||
return await self.app(scope, receive, send)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue