Fix missing result_backend on Debian 10/11

For whatever reason, a Celery worker on <5.2.x was not picking these up.
Move them back to the root of the module so they are properly picked up
on these older versions but still prevents calling the routing functions
during an API doc generation.
This commit is contained in:
Joshua Boniface 2023-11-25 15:16:56 -05:00
parent 3e001b08b6
commit 24cabd3b99
1 changed files with 6 additions and 2 deletions

View File

@ -141,11 +141,15 @@ celery = Celery(
result_backend=celery_task_uri, result_backend=celery_task_uri,
result_extended=True, result_extended=True,
) )
app.config["broker_url"] = celery_task_uri
app.config["result_backend"] = celery_task_uri
celery.conf.update(app.config)
def celery_startup(): def celery_startup():
app.config["CELERY_broker_url"] = celery_task_uri """
app.config["result_backend"] = celery_task_uri Runs when the API daemon starts, but not the Celery workers or the API doc generator
"""
app.config["task_queues"] = tuple( app.config["task_queues"] = tuple(
[Queue(h, routing_key=f"{h}.#") for h in get_all_nodes()] [Queue(h, routing_key=f"{h}.#") for h in get_all_nodes()]
) )