Skip to content

Commit d96a1cd

Browse files
authored
Fix: Lifespan events were not relayed to AlephApp
Problem: @app.on_event("startup") would not be triggered on uvicorn startup Solution: Relay "lifespan" events from the AlephApp to the http_app
1 parent 23461fd commit d96a1cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/aleph/sdk/vm/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def __call__(
6262
receive: Optional[Callable[[], Awaitable[Any]]] = None,
6363
send: Optional[Callable[[Dict[Any, Any]], Awaitable[Any]]] = None,
6464
):
65-
if scope["type"] in ("http", "websocket"):
65+
if scope["type"] in ("http", "websocket", "lifespan"):
6666
if self.http_app:
6767
await self.http_app(scope=scope, receive=receive, send=send)
6868
else:

0 commit comments

Comments
 (0)