RuntimeError: Cannot add middleware after an application has started
lijc210 opened this issue · comments
fastapi 0.100.0/0.101.1
fastapi_amis_admin 0.6.4
fastapi_scheduler 0.0.13
The code has been modified to work as follows
site.mount_app(app)
@app.on_event("startup")
async def startup():
# Mount the background management system
# site.mount_app(app)
# Start the scheduled task scheduler
scheduler.start()