Skip to content

Commit

Permalink
docs: explain when to pass sentinel config
Browse files Browse the repository at this point in the history
  • Loading branch information
nsantacruz committed Mar 28, 2024
1 parent df020f8 commit 9fc97f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/celery_setup/generate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def add_password_to_url(url, password):
return re.sub(r'((?:redis|sentinel)://)', fr'\1:{password}@', url)


def generate_config(redis_config: RedisConfig, sentinel_config: SentinelConfig) -> dict:
def generate_config(redis_config: RedisConfig, sentinel_config: SentinelConfig = None) -> dict:
"""
:param redis_config: required, whether connecting to redis or redis sentinel, the redis config is required.
:param sentinel_config: optional, only pass if connecting to redis sentinel
"""
if sentinel_config.is_configured():
redisdns = dns.resolver.resolve(sentinel_config.url, 'A')
addressstring = []
Expand Down

0 comments on commit 9fc97f2

Please sign in to comment.