From 24cabd3b993e205991f09f83f4f8f812211c43d2 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 25 Nov 2023 15:16:56 -0500 Subject: [PATCH] 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. --- api-daemon/pvcapid/flaskapi.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api-daemon/pvcapid/flaskapi.py b/api-daemon/pvcapid/flaskapi.py index 6e4d5e81..c2f1ee0e 100755 --- a/api-daemon/pvcapid/flaskapi.py +++ b/api-daemon/pvcapid/flaskapi.py @@ -141,11 +141,15 @@ celery = Celery( result_backend=celery_task_uri, 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(): - 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( [Queue(h, routing_key=f"{h}.#") for h in get_all_nodes()] )