File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 66from fastapp .utils import setup_opentelemetry
77
88
9- def get_app (lifespan ) -> FastAPI :
9+ @asynccontextmanager
10+ async def lifespan (app : FastAPI ) -> None :
11+ """Gracefully start the application before the server reports readiness."""
12+ setup_opentelemetry (app = app )
13+ yield
14+ pass
15+
16+
17+ def get_app () -> FastAPI :
1018 """Setup the Fast API server.
1119
1220 RETURNS (FastAPI): The FastAPI object to start the server.
@@ -23,12 +31,4 @@ def get_app(lifespan) -> FastAPI:
2331 return app
2432
2533
26- @asynccontextmanager
27- async def lifespan (app : FastAPI ) -> None :
28- """Gracefully start the application before the server reports readiness."""
29- setup_opentelemetry (app = app )
30- yield
31- pass
32-
33-
34- app = get_app (lifespan = lifespan )
34+ app = get_app ()
You can’t perform that action at this time.
0 commit comments