mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
safe None handling in ``database_connection_timeout`` fix
This commit is contained in:
parent
7a62c69273
commit
36b7734dbf
1 changed files with 8 additions and 8 deletions
|
|
@ -905,19 +905,19 @@ def run_server( # noqa: PLR0915
|
|||
database_url = construct_database_url_from_env_vars()
|
||||
if database_url:
|
||||
os.environ["DATABASE_URL"] = database_url
|
||||
db_connection_pool_limit = int(
|
||||
general_settings.get(
|
||||
"database_connection_pool_limit",
|
||||
LiteLLMDatabaseConnectionPool.database_connection_pool_limit.value,
|
||||
)
|
||||
db_connection_pool_limit = general_settings.get(
|
||||
"database_connection_pool_limit",
|
||||
LiteLLMDatabaseConnectionPool.database_connection_pool_limit.value,
|
||||
)
|
||||
db_connection_timeout = general_settings.get("database_connection_timeout")
|
||||
if db_connection_timeout is None:
|
||||
db_connection_timeout = general_settings.get(
|
||||
"database_connection_pool_timeout",
|
||||
LiteLLMDatabaseConnectionPool.database_connection_pool_timeout.value,
|
||||
"database_connection_pool_timeout"
|
||||
)
|
||||
if db_connection_timeout is None:
|
||||
db_connection_timeout = (
|
||||
LiteLLMDatabaseConnectionPool.database_connection_pool_timeout.value
|
||||
)
|
||||
db_connection_timeout = int(db_connection_timeout)
|
||||
if database_url and database_url.startswith("os.environ/"):
|
||||
original_dir = os.getcwd()
|
||||
# set the working directory to where this script is
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue