From 5533bae94615b018c4eeabf99f20bffc98e9a874 Mon Sep 17 00:00:00 2001 From: Ben Larabie Date: Wed, 11 Oct 2023 10:13:18 -0400 Subject: [PATCH] adding init script to ANOTHER script --- scripts/run_celery_send_sms.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/run_celery_send_sms.sh b/scripts/run_celery_send_sms.sh index 1b8ea7de50..e6c32a5d75 100755 --- a/scripts/run_celery_send_sms.sh +++ b/scripts/run_celery_send_sms.sh @@ -2,8 +2,27 @@ # runs celery with only the send-sms-* queues +init() +{ + # Wait for cwagent to become available. + while : + do + if nc -vz $STATSD_HOST 25888; then + echo "CWAgent is Ready." + break; + else + echo "Waiting for CWAgent to become ready." + sleep 1 + fi + done +} + set -e +if [[ -z "${STATSD_HOST}" ]]; then + init +fi + echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}" # TODO: we shouldn't be using the send-sms-tasks queue anymore - once we verify this we can remove it