ianbuss commented on code in PR #43817: URL: https://github.com/apache/airflow/pull/43817#discussion_r1834216466
########## airflow/api_fastapi/app.py: ########## @@ -28,6 +30,18 @@ app: FastAPI | None = None +@asynccontextmanager +async def lifespan(app: FastAPI): + async with AsyncExitStack() as stack: + for route in app.routes: + if isinstance(route, Mount) and isinstance(route.app, FastAPI): + await stack.enter_async_context( + route.app.router.lifespan_context(route.app), Review Comment: It will always have a lifespan https://github.com/encode/starlette/blob/c2e3a39b09a613553ee03586589ed9cd0fbf07f3/starlette/routing.py#L612 but I can add a check in if you want to ensure there's no regression. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
