Skip to content

Commit

Permalink
Update start-flower in flower to wait until all celery workers are on…
Browse files Browse the repository at this point in the history
…line (#5012)

Flower needs to start only after the celery workers come online. Otherwise one will see errors like `inspect method failed` etc
  • Loading branch information
arnav13081994 committed Jun 15, 2024
1 parent c3335e6 commit 401ffd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down

0 comments on commit 401ffd0

Please sign in to comment.