Skip to content

Commit 765445e

Browse files
committed
updated for method validate_async_redis and changed condtion to hasattr
1 parent 4d69ed1 commit 765445e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

redisvl/redis/connection.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,8 @@ def validate_sync_redis(
398398
except ResponseError:
399399
# Fall back to a simple log echo
400400
# For RedisCluster, echo is not available
401-
if not isinstance(redis_client, RedisCluster):
402-
redis_client.echo(_lib_name)
403-
401+
if hasattr(redis_client, "echo"):
402+
await redis_client.echo(_lib_name)
404403

405404
# Get list of modules
406405
installed_modules = RedisConnectionFactory.get_modules(redis_client)
@@ -426,6 +425,8 @@ async def validate_async_redis(
426425
except ResponseError:
427426
# Fall back to a simple log echo
428427
await redis_client.echo(_lib_name)
428+
if hasattr(redis_client, "echo"):
429+
await redis_client.echo(_lib_name)
429430

430431
# Get list of modules
431432
installed_modules = await RedisConnectionFactory.get_modules_async(redis_client)

0 commit comments

Comments
 (0)