]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Mention in docs that subapps don't fire events (#1554)
authorAndrew <amacfie@sent.com>
Sun, 14 Jun 2020 16:25:10 +0000 (12:25 -0400)
committerGitHub <noreply@github.com>
Sun, 14 Jun 2020 16:25:10 +0000 (18:25 +0200)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
docs/en/docs/advanced/events.md

index 8b3dc7af1859e43c44e979a1874902f46eabd6ff..7cd2998f05a57bb66ef8196f40c60fffa4958e70 100644 (file)
@@ -4,6 +4,9 @@ You can define event handlers (functions) that need to be executed before the ap
 
 These functions can be declared with `async def` or normal `def`.
 
+!!! warning
+    Only event handlers for the main application will be executed, not for [Sub Applications - Mounts](./sub-applications.md){.internal-link target=_blank}.
+
 ## `startup` event
 
 To add a function that should be run before the application starts, declare it with the event `"startup"`:
@@ -41,4 +44,4 @@ Here, the `shutdown` event handler function will write a text line `"Application
     So, we declare the event handler function with standard `def` instead of `async def`.
 
 !!! info
-    You can read more about these event handlers in <a href="https://www.starlette.io/events/" class="external-link" target="_blank">Starlette's  Events' docs</a>.
\ No newline at end of file
+    You can read more about these event handlers in <a href="https://www.starlette.io/events/" class="external-link" target="_blank">Starlette's  Events' docs</a>.