Skip to content
Snippets Groups Projects
Commit 92d1f727 authored by Neda Moeini's avatar Neda Moeini
Browse files

Add redis auth credentials to celery backend config.

parent 4b7f3c8c
Branches
Tags
1 merge request!12Add redis auth credentials to celery backend config.
......@@ -34,6 +34,7 @@ redis_socket_timeout = params.get(
_broker_hostname = params['hostname']
_broker_port = params['port']
_broker_password = params.get('password')
_broker_db_index = params.get('celery-db-index', DEFAULT_CELERY_DB_INDEX)
......@@ -41,8 +42,12 @@ if ':' in _broker_hostname:
# assume this means hostname is an ipv6 address
_broker_hostname = f'[{_broker_hostname}]'
broker_url = result_backend = (f'{_broker_scheme}://{_broker_hostname}'
f':{_broker_port}/{_broker_db_index}')
broker_url = result_backend = (
f'{_broker_scheme}://'
f'{"" if not _broker_password else f":{_broker_password}@"}'
f'{_broker_hostname}:{_broker_port}/{_broker_db_index}'
)
logger.debug('broker_url: %r' % broker_url)
task_eager_propagates = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment