📝 Add warning about lifespan functions and backwards compatibility with events (#10734)

Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
This commit is contained in:
Jacob McDonald
2024-01-12 09:03:25 -05:00
committed by GitHub
parent dc704036a2
commit 7e0e16fa36

View File

@@ -92,7 +92,7 @@ The `lifespan` parameter of the `FastAPI` app takes an **async context manager**
## Alternative Events (deprecated)
!!! warning
The recommended way to handle the *startup* and *shutdown* is using the `lifespan` parameter of the `FastAPI` app as described above.
The recommended way to handle the *startup* and *shutdown* is using the `lifespan` parameter of the `FastAPI` app as described above. If you provide a `lifespan` parameter, `startup` and `shutdown` event handlers will no longer be called. It's all `lifespan` or all events, not both.
You can probably skip this part.