From: Jacob McDonald <48448372+jacob-indigo@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:03:25 +0000 (-0500) Subject: 📝 Add warning about lifespan functions and backwards compatibility with events (... X-Git-Tag: 0.109.1~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e0e16fa3669d83a9992ff5aee669135ebb41fc1;p=thirdparty%2Ffastapi%2Ffastapi.git 📝 Add warning about lifespan functions and backwards compatibility with events (#10734) Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com> --- diff --git a/docs/en/docs/advanced/events.md b/docs/en/docs/advanced/events.md index 6df1411d1f..ca9d86ae41 100644 --- a/docs/en/docs/advanced/events.md +++ b/docs/en/docs/advanced/events.md @@ -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.