feat: add SIGTERM handling and update typer dependency (#4548)

* Update `typer` dependency to version 0.13.0 in `pyproject.toml`

* refactor: Simplify exception handling in the CLI

* Enhance lifespan function with clean shutdown and logging improvements

* Add graceful shutdown handling for SIGTERM and SIGINT signals

- Introduce signal handlers to manage SIGTERM and SIGINT for graceful server shutdown.
- Update exception handling to ensure processes terminate properly and log shutdown events.
- Modify server run logic to support signal-based shutdowns, improving reliability.

---------

Co-authored-by: Nadir J <31660040+NadirJ@users.noreply.github.com>
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-11-12 21:42:18 -03:00 • committed by GitHub
commit f8f9b7cace
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 66 additions and 25 deletions

View file

@ -119,7 +119,7 @@ dependencies = [
"langchain-experimental>=0.0.61",
"pydantic>=2.7.0",
"pydantic-settings>=2.2.0",
"typer>=0.12.0",
"typer>=0.13.0",
"cachetools>=5.3.1",
"platformdirs>=4.2.0",
"python-multipart>=0.0.12",