This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"startup" and "shutdown" events not triggered for mounted APIs #1480
Comments
Duplicate with #811. |
on_startup and on_shutdown only triggered for the the top level app object. That is the expected behaviour in FastAPI. |
That makes it hard to modularize the application though. At least on_event() should raise if the event can't be subscribed to. What would be the downside of not making these events work on mounted apis? |
See encode/starlette#649, it's an upstream issue. |
thanks. Anyway, closing in favor of #811 then |
Thanks for coming back to close this one! ☕
|
Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Describe the bug
"startup" and "shutdown" events not triggered for mounted APIs
To Reproduce
startup/shutdown is triggered for
app
but notsubapp
Expected behavior
Events are emitted in both cases
The text was updated successfully, but these errors were encountered: