mirror of https://github.com/tiangolo/fastapi.git
📝 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:
parent
dc704036a2
commit
7e0e16fa36
|
|
@ -92,7 +92,7 @@ The `lifespan` parameter of the `FastAPI` app takes an **async context manager**
|
||||||
## Alternative Events (deprecated)
|
## Alternative Events (deprecated)
|
||||||
|
|
||||||
!!! warning
|
!!! 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.
|
You can probably skip this part.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue