File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
packages/service-library/src/servicelib Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1313class FastAPIAppServer (BaseAppServer [FastAPI ]):
1414 def __init__ (self , app : FastAPI ):
1515 super ().__init__ (app )
16+ self ._lifespan_manager : LifespanManager | None = None
17+
18+ async def on_startup (self ) -> None :
1619 self ._lifespan_manager = LifespanManager (
17- app ,
20+ self . app ,
1821 startup_timeout = _STARTUP_TIMEOUT ,
1922 shutdown_timeout = _SHUTDOWN_TIMEOUT ,
2023 )
21-
22- async def on_startup (self ) -> None :
2324 await self ._lifespan_manager .__aenter__ ()
2425
2526 async def on_shutdown (self ) -> None :
Original file line number Diff line number Diff line change 99
1010STARTUP_TIMEOUT : Final [float ] = datetime .timedelta (minutes = 1 ).total_seconds ()
1111
12- AppType = TypeVar ("AppType " )
12+ T = TypeVar ("T " )
1313
1414
15- class BaseAppServer (ABC , Generic [AppType ]):
16- def __init__ (self , app : AppType ) -> None :
17- self ._app : AppType = app
15+ class BaseAppServer (ABC , Generic [T ]):
16+ def __init__ (self , app : T ) -> None :
17+ self ._app : T = app
1818 self ._shutdown_event : asyncio .Event | None = None
1919
2020 @property
21- def app (self ) -> AppType :
21+ def app (self ) -> T :
2222 return self ._app
2323
2424 @property
You can’t perform that action at this time.
0 commit comments