Skip to content

Commit

Permalink
fix async client init (#16321)
Browse files Browse the repository at this point in the history
  • Loading branch information
logan-markewich authored Oct 1, 2024
1 parent 254c683 commit 0491ab7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,12 @@ def _aget_client(self, redis_url: str, **kwargs: Any) -> "AsyncRedis":
redis_client = self._aredis_sentinel_client(redis_url, **kwargs)
else:
# connect to redis server from url, reconnect with cluster client if needed
redis_client = redis.asyncio.from_url(redis_url, **kwargs)
if self._check_for_cluster(redis_client):
redis_client.close()
redis_client = self._aredis_cluster_client(redis_url, **kwargs)
return redis_client
aredis_client = redis.asyncio.from_url(redis_url, **kwargs)
redis_client = redis.from_url(redis_url, **kwargs)
is_cluster = self._check_for_cluster(redis_client)
redis_client.close()

if is_cluster:
aredis_client.close()
aredis_client = self._aredis_cluster_client(redis_url, **kwargs)
return aredis_client
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-storage-chat-store-redis"
readme = "README.md"
version = "0.3.1"
version = "0.3.2"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand Down

0 comments on commit 0491ab7

Please sign in to comment.