Add password to sync sentinel client (#9622)

This commit is contained in:
jmarshall-medallia 2025-03-30 03:38:54 -03:00 committed by GitHub
parent 31082344a4
commit da953c74a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -202,6 +202,7 @@ def init_redis_cluster(redis_kwargs) -> redis.RedisCluster:
def _init_redis_sentinel(redis_kwargs) -> redis.Redis:
sentinel_nodes = redis_kwargs.get("sentinel_nodes")
sentinel_password = redis_kwargs.get("sentinel_password")
service_name = redis_kwargs.get("service_name")
if not sentinel_nodes or not service_name:
@ -212,7 +213,11 @@ def _init_redis_sentinel(redis_kwargs) -> redis.Redis:
verbose_logger.debug("init_redis_sentinel: sentinel nodes are being initialized.")
# Set up the Sentinel client
sentinel = redis.Sentinel(sentinel_nodes, socket_timeout=0.1)
sentinel = redis.Sentinel(
sentinel_nodes,
socket_timeout=0.1,
password=sentinel_password,
)
# Return the master instance for the given service