mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
(redis fix) - fix AbstractConnection.__init__() got an unexpected keyword argument 'ssl'
(#6908)
* add better debugging for get_redis_connection_pool + allow passing ssl=None * test_redis_with_ssl * test_redis_with_ssl * test_redis_with_ssl
This commit is contained in:
parent
fcb5bfe896
commit
9ef09ec4c1
2 changed files with 28 additions and 1 deletions
|
@ -313,12 +313,13 @@ def get_redis_async_client(**env_overrides) -> async_redis.Redis:
|
|||
|
||||
def get_redis_connection_pool(**env_overrides):
|
||||
redis_kwargs = _get_redis_client_logic(**env_overrides)
|
||||
verbose_logger.debug("get_redis_connection_pool: redis_kwargs", redis_kwargs)
|
||||
if "url" in redis_kwargs and redis_kwargs["url"] is not None:
|
||||
return async_redis.BlockingConnectionPool.from_url(
|
||||
timeout=5, url=redis_kwargs["url"]
|
||||
)
|
||||
connection_class = async_redis.Connection
|
||||
if "ssl" in redis_kwargs and redis_kwargs["ssl"] is not None:
|
||||
if "ssl" in redis_kwargs:
|
||||
connection_class = async_redis.SSLConnection
|
||||
redis_kwargs.pop("ssl", None)
|
||||
redis_kwargs["connection_class"] = connection_class
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue