mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
fix: pass socket timeouts to Redis cluster clients (#27920)
Squash-merged by litellm-agent from tomdee's PR.
This commit is contained in:
parent
a66b96579e
commit
ef68ef76b6
2 changed files with 9 additions and 1 deletions
|
|
@ -100,6 +100,8 @@ def _get_redis_cluster_kwargs(client=None):
|
|||
"azure_tenant_id",
|
||||
"azure_client_secret",
|
||||
"max_connections",
|
||||
"socket_timeout",
|
||||
"socket_connect_timeout",
|
||||
}
|
||||
|
||||
return available_args
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import json
|
||||
import os
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
|
@ -165,6 +164,13 @@ def test_max_connections_in_cluster_kwargs():
|
|||
), "max_connections should be in available Redis cluster kwargs"
|
||||
|
||||
|
||||
def test_socket_timeouts_in_cluster_kwargs():
|
||||
"""Test that Redis cluster clients can receive socket timeout configuration"""
|
||||
kwargs = _get_redis_cluster_kwargs()
|
||||
assert "socket_timeout" in kwargs
|
||||
assert "socket_connect_timeout" in kwargs
|
||||
|
||||
|
||||
def test_get_redis_async_client_with_connection_pool():
|
||||
"""Test that connection_pool parameter is properly passed to Redis client"""
|
||||
# Create a mock connection pool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue