File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 - ' *'
1010 paths :
1111 - ' runtimes/**'
12+ - ' infrastructure/**'
1213 - ' docker-compose.*'
1314 - ' dockerfiles/**'
1415 - ' .github/workflows/ci.yml'
Original file line number Diff line number Diff line change @@ -75,6 +75,13 @@ async def startup_event() -> None:
7575
7676handler = Mangum (app , lifespan = "off" )
7777
78+
79+ async def _enter_lifespan () -> None :
80+ """Run app startup without shutdown (for SnapStart snapshot initialization)."""
81+ cm = app .router .lifespan_context (app )
82+ await cm .__aenter__ ()
83+
84+
7885if "AWS_EXECUTION_ENV" in os .environ :
7986 loop = asyncio .get_event_loop ()
80- loop .run_until_complete (app . router . startup ())
87+ loop .run_until_complete (_enter_lifespan ())
Original file line number Diff line number Diff line change @@ -105,6 +105,13 @@ async def startup_event() -> None:
105105
106106handler = Mangum (app , lifespan = "off" )
107107
108+
109+ async def _enter_lifespan () -> None :
110+ """Run app startup without shutdown (for SnapStart snapshot initialization)."""
111+ cm = app .router .lifespan_context (app )
112+ await cm .__aenter__ ()
113+
114+
108115if "AWS_EXECUTION_ENV" in os .environ :
109116 loop = asyncio .get_event_loop ()
110- loop .run_until_complete (app . router . startup ())
117+ loop .run_until_complete (_enter_lifespan ())
Original file line number Diff line number Diff line change @@ -111,6 +111,13 @@ async def startup_event() -> None:
111111
112112handler = Mangum (app , lifespan = "off" )
113113
114+
115+ async def _enter_lifespan () -> None :
116+ """Run app startup without shutdown (for SnapStart snapshot initialization)."""
117+ cm = app .router .lifespan_context (app )
118+ await cm .__aenter__ ()
119+
120+
114121if "AWS_EXECUTION_ENV" in os .environ :
115122 loop = asyncio .get_event_loop ()
116- loop .run_until_complete (app . router . startup ())
123+ loop .run_until_complete (_enter_lifespan ())
You can’t perform that action at this time.
0 commit comments