diff --git a/Dockerfile b/Dockerfile index 2864f78ae..fd09c620d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,6 +33,8 @@ ENV DEFAULT_URL=/uber ENV DEBUG=false ENV SESSION_HOST=redis ENV SESSION_PORT=6379 +ENV SESSION_PREFIX=uber +ENV BROKER_PROTOCOL=amqp ENV BROKER_HOST=rabbitmq ENV BROKER_PORT=5672 ENV BROKER_USER=celery diff --git a/requirements.txt b/requirements.txt index 5d7287de9..b7778e8f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,4 +26,8 @@ Jinja2==2.11.3 requests==2.27.1 signnow_python_sdk==2.0.1 Authlib==1.0.1 -pyyaml==6.0 \ No newline at end of file +requests==2.27.1 +signnow_python_sdk==2.0.1 +Authlib==1.0.1 +pyyaml==6.0 +librabbitmq==2.0.0 \ No newline at end of file diff --git a/sideboard-development.ini.template b/sideboard-development.ini.template index 2ef3d9be8..ee68a25d4 100644 --- a/sideboard-development.ini.template +++ b/sideboard-development.ini.template @@ -11,6 +11,7 @@ server.socket_timeout = 1 server.thread_pool = 100 tools.sessions.host = "${SESSION_HOST}" tools.sessions.port = ${SESSION_PORT} +tools.sessions.prefix = "${SESSION_PREFIX}" tools.sessions.storage_type = "redis" tools.sessions.timeout = 60 diff --git a/uber-development.ini.template b/uber-development.ini.template index 7f7ef9a4c..56006897b 100644 --- a/uber-development.ini.template +++ b/uber-development.ini.template @@ -3,4 +3,4 @@ hostname = "${HOSTNAME}" url_root = "http://${HOSTNAME}:${PORT}" [secret] -broker_url = "amqp://${BROKER_USER}:${BROKER_PASS}@${BROKER_HOST}:${BROKER_PORT}/${BROKER_VHOST}" +broker_url = "${BROKER_PROTOCOL}://${BROKER_USER}:${BROKER_PASS}@${BROKER_HOST}:${BROKER_PORT}/${BROKER_VHOST}" diff --git a/uber/tasks/__init__.py b/uber/tasks/__init__.py index 6a4065bef..3b88b42fa 100644 --- a/uber/tasks/__init__.py +++ b/uber/tasks/__init__.py @@ -12,7 +12,13 @@ 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']) + +broker_url = config_dict['secret']['broker_url'] + +celery.conf.update(broker_url=broker_url) +celery.conf.update(result_backend=broker_url.replace("amqps://", "rpc://")) +celery.conf.update(task_ignore_result=True) + celery.conf.update(result_backend=config_dict['secret']['broker_url'].replace("amqp://", "rpc://")) celery.conf.update(task_ignore_result=True)