File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 25
25
async def app_lifespan (app : FastAPI ) -> AsyncGenerator [None , None ]:
26
26
"""Handle lifespan management things, like mTLS client init"""
27
27
# init
28
+ LOGGER .debug ("DB startup" )
28
29
dbwrapper = DBWrapper (gino = dbbase .db , config = DBConfig .singleton ())
29
30
await dbwrapper .app_startup_event ()
30
31
_ = app
32
+ LOGGER .debug ("JWT and mTLS inits" )
31
33
await jwt_init ()
32
34
await mtls_init ()
33
35
reporter = asyncio .get_running_loop ().create_task (report_to_kraftwerk ())
34
36
# App runs
37
+ LOGGER .debug ("Yield" )
35
38
yield
36
39
# Cleanup
40
+ LOGGER .debug ("Cleanup" )
37
41
await reporter # Just to avoid warning about task that was not awaited
38
42
await TaskMaster .singleton ().stop_lingering_tasks () # Make sure teasks get finished
39
43
await dbwrapper .app_shutdown_event ()
You can’t perform that action at this time.
0 commit comments