File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 11import typing as t
22from contextlib import asynccontextmanager
33
4- from anyio import create_task_group
54from ellar .common import IApplicationShutdown , IApplicationStartup
65from ellar .common .logging import logger
76
@@ -57,17 +56,15 @@ async def run_all_shutdown_actions(self, app: "App") -> None:
5756
5857 @asynccontextmanager
5958 async def lifespan (self , app : "App" ) -> t .AsyncIterator [t .Any ]:
60- logger .debug ("Executing Modules Startup Handlers" )
61-
6259 try :
63- async with create_task_group () as tg :
64- tg . start_soon ( self .run_all_startup_actions , app )
60+ logger . debug ( "Executing Modules Startup Handlers" )
61+ await self .run_all_startup_actions ( app )
6562
6663 async with self ._lifespan_context (app ) as ctx : # type:ignore[attr-defined]
6764 logger .info ("Application is ready." )
6865 yield ctx
6966 finally :
7067 logger .debug ("Executing Modules Shutdown Handlers" )
71- async with create_task_group () as tg :
72- tg . start_soon ( self . run_all_shutdown_actions , app )
68+ await self . run_all_shutdown_actions ( app )
69+
7370 logger .info ("Application shutdown successfully." )
You can’t perform that action at this time.
0 commit comments