Skip to content

Commit

Permalink
Munging amqp ssl support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbyt3r committed Aug 2, 2023
1 parent 8cddb59 commit 482368a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions uber/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
celery.conf.beat_schedule = {}
celery.conf.beat_startup_tasks = []
celery.conf.update(config_dict['celery'])
celery.conf.update(broker_url=config_dict['secret']['broker_url'])
celery.conf.update(result_backend=config_dict['secret']['broker_url'].replace("amqp://", "rpc://"))

broker_url = config_dict['secret']['broker_url']
if broker_url.startswith("amqps://"):
celery.conf.update(broker_use_ssl=True)
broker_url = broker_url.replace("amqps://", "amqp://")

celery.conf.update(broker_url=broker_url)
celery.conf.update(result_backend=broker_url.replace("amqp://", "rpc://"))
celery.conf.update(task_ignore_result=True)

def celery_on_startup(fn, *args, **kwargs):
Expand Down

0 comments on commit 482368a

Please sign in to comment.