diff --git a/api-daemon/pvcapid/flaskapi.py b/api-daemon/pvcapid/flaskapi.py index f1d084d7..a40dd73a 100755 --- a/api-daemon/pvcapid/flaskapi.py +++ b/api-daemon/pvcapid/flaskapi.py @@ -56,12 +56,11 @@ from flask_sqlalchemy import SQLAlchemy # Create Flask app and set config values app = flask.Flask(__name__) -app.config["CELERY_BROKER_URL"] = "redis://{}:{}{}".format( - config["queue_host"], config["queue_port"], config["queue_path"] -) -app.config["CELERY_RESULT_BACKEND"] = "redis://{}:{}{}".format( +celery_task_uri = "redis://{}:{}{}".format( config["queue_host"], config["queue_port"], config["queue_path"] ) +app.config["CELERY_BROKER_URL"] = celery_task_uri +app.config["CELERY_RESULT_BACKEND"] = celery_task_uri # Set up Celery queues @@ -132,7 +131,12 @@ api = Api(blueprint) app.register_blueprint(blueprint) # Create celery definition -celery = Celery(app.name, broker=app.config["CELERY_BROKER_URL"]) +celery = Celery( + app.name, + broker=celery_task_uri, + result_backend=celery_task_uri, + result_extended=True, +) celery.conf.update(app.config) #