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:
parent
e4fe9394b1
commit
4340949f57
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user