Skip to content

Commit 6c1fd86

Browse files
committed
log lifespan events
1 parent 3ddbb87 commit 6c1fd86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/rasenmaeher_api/web/application.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,19 @@
2525
async def app_lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
2626
"""Handle lifespan management things, like mTLS client init"""
2727
# init
28+
LOGGER.debug("DB startup")
2829
dbwrapper = DBWrapper(gino=dbbase.db, config=DBConfig.singleton())
2930
await dbwrapper.app_startup_event()
3031
_ = app
32+
LOGGER.debug("JWT and mTLS inits")
3133
await jwt_init()
3234
await mtls_init()
3335
reporter = asyncio.get_running_loop().create_task(report_to_kraftwerk())
3436
# App runs
37+
LOGGER.debug("Yield")
3538
yield
3639
# Cleanup
40+
LOGGER.debug("Cleanup")
3741
await reporter # Just to avoid warning about task that was not awaited
3842
await TaskMaster.singleton().stop_lingering_tasks() # Make sure teasks get finished
3943
await dbwrapper.app_shutdown_event()

0 commit comments

Comments
 (0)