Skip to content

Commit 401ffd0

Browse files
Update start-flower in flower to wait until all celery workers are online (#5012)
Flower needs to start only after the celery workers come online. Otherwise one will see errors like `inspect method failed` etc
1 parent c3335e6 commit 401ffd0

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

  • {{cookiecutter.project_slug}}/compose
    • local/django/celery/flower
    • production/django/celery/flower

{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
set -o errexit
44
set -o nounset
55

6+
7+
until timeout 10 celery -A config.celery_app inspect ping; do
8+
>&2 echo "Celery workers not available"
9+
done
10+
11+
echo 'Starting flower'
12+
13+
614
exec watchfiles --filter python celery.__main__.main \
715
--args \
816
"-A config.celery_app -b \"${CELERY_BROKER_URL}\" flower --basic_auth=\"${CELERY_FLOWER_USER}:${CELERY_FLOWER_PASSWORD}\""

{{cookiecutter.project_slug}}/compose/production/django/celery/flower/start

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ set -o errexit
44
set -o nounset
55

66

7+
8+
until timeout 10 celery -A config.celery_app inspect ping; do
9+
>&2 echo "Celery workers not available"
10+
done
11+
12+
echo 'Starting flower'
13+
14+
715
exec celery \
816
-A config.celery_app \
917
-b "${CELERY_BROKER_URL}" \

0 commit comments

Comments
 (0)