Skip to content

Commit 7724b21

Browse files
committed
dropped task execution for module lifespan actions
1 parent 9ebb844 commit 7724b21

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

ellar/app/lifespan.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import typing as t
22
from contextlib import asynccontextmanager
33

4-
from anyio import create_task_group
54
from ellar.common import IApplicationShutdown, IApplicationStartup
65
from 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.")

0 commit comments

Comments
 (0)