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 6
6
from fastapp .utils import setup_opentelemetry
7
7
8
8
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 :
10
18
"""Setup the Fast API server.
11
19
12
20
RETURNS (FastAPI): The FastAPI object to start the server.
@@ -23,12 +31,4 @@ def get_app(lifespan) -> FastAPI:
23
31
return app
24
32
25
33
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