From 36b7734dbf23b4fcabe3a509688815280aac4e15 Mon Sep 17 00:00:00 2001 From: harish-berri Date: Mon, 11 May 2026 17:23:26 +0000 Subject: [PATCH] safe None handling in ```database_connection_timeout``` fix --- litellm/proxy/proxy_cli.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py index 12388f4de80..676b227f35a 100644 --- a/litellm/proxy/proxy_cli.py +++ b/litellm/proxy/proxy_cli.py @@ -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