From 9d87c5a726783564c813085c741417d8c87ee9ff Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 19 Apr 2024 21:41:58 +0530 Subject: [PATCH 1/2] Update start in local flower Flower needs to start only after the celery workers come online. otherwise one will see errors like `inspect method failed` etc --- .../compose/local/django/celery/flower/start | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start index b4783d2f0d..cebb62203a 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start @@ -3,6 +3,14 @@ set -o errexit set -o nounset + +until timeout 10 celery -A config.celery_app inspect ping; do + >&2 echo "Celery workers not available" +done + +echo 'Starting flower' + + exec watchfiles --filter python celery.__main__.main \ --args \ "-A config.celery_app -b \"${CELERY_BROKER_URL}\" flower --basic_auth=\"${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}\"" From e91a54a15bac2d3d9063bbc370f523ded3f47fde Mon Sep 17 00:00:00 2001 From: Arnav Choudhury Date: Fri, 19 Apr 2024 21:42:23 +0530 Subject: [PATCH 2/2] Update start Flower needs to start only after the celery workers come online. otherwise one will see errors like `inspect method failed` etc --- .../compose/production/django/celery/flower/start | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start index 4180d6778d..f903a05a26 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start +++ b/{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start @@ -4,6 +4,14 @@ set -o errexit set -o nounset + +until timeout 10 celery -A config.celery_app inspect ping; do + >&2 echo "Celery workers not available" +done + +echo 'Starting flower' + + exec celery \ -A config.celery_app \ -b "${CELERY_BROKER_URL}" \