cookiecutter-django/{{cookiecutter.project_slug}}/compose/local/django/celery/flower/start
Arnav Choudhury 401ffd0e86
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
2024-06-15 23:55:43 +01:00

17 lines
377 B
Bash

#!/bin/bash
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}\""