fix: make startup and shutdown event handlers async in common provider

- Fix TypeError: object NoneType can't be used in 'await' expression
- FastAPI requires event handlers to be async functions
- This was blocking the entire application startup sequence
- Fixes the issue where message queue consumers were not starting properly
This commit is contained in:
Nicolas 2025-08-08 12:33:14 +08:00
parent e4fe9394b1
commit 4340949f57

View File

@ -11,13 +11,13 @@ def register(app):
# This hook ensures that a connection is opened to handle any queries # This hook ensures that a connection is opened to handle any queries
# generated by the request. # generated by the request.
@app.on_event("startup") @app.on_event("startup")
def startup(): async def startup():
pass pass
# This hook ensures that the connection is closed when we've finished # This hook ensures that the connection is closed when we've finished
# processing the request. # processing the request.
@app.on_event("shutdown") @app.on_event("shutdown")
def shutdown(): async def shutdown():
pass pass