Skip to content

Commit

Permalink
Merge branch 'main' into email-deliver-queues
Browse files Browse the repository at this point in the history
  • Loading branch information
jimleroyer authored Oct 11, 2023
2 parents 6e0c512 + d45511d commit bbb743e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/run_celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,29 @@

# runs celery with all celery queues except the throtted sms queue

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

# Check and see if this is running in K8s and if so, wait for cloudwatch agent
if [[ -z "${STATSD_HOST}" ]]; then
init
fi

echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}"

celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=${CELERY_CONCURRENCY-4} -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-sms-tasks,send-sms-high,send-sms-medium,send-sms-low,send-email-tasks,service-callbacks,delivery-receipts
22 changes: 22 additions & 0 deletions scripts/run_celery_no_sms_sending.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
#!/bin/sh

# runs celery with only the throttled sms sending queue

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
}

# runs celery with all celery queues except send-throttled-sms-tasks, send-sms-tasks, send-sms-high, send-sms-medium, or send-sms-low

set -e

# Check and see if this is running in K8s and if so, wait for cloudwatch agent
if [[ -z "${STATSD_HOST}" ]]; then
init
fi

echo "Start celery, concurrency: ${CELERY_CONCURRENCY-4}"

celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=${CELERY_CONCURRENCY-4} -Q database-tasks,-priority-database-tasks.fifo,-normal-database-tasks,-bulk-database-tasks,job-tasks,notify-internal-tasks,periodic-tasks,priority-tasks,normal-tasks,bulk-tasks,reporting-tasks,research-mode-tasks,retry-tasks,send-email-tasks,send-email-high,send-email-medium,send-email-low,service-callbacks,delivery-receipts
19 changes: 19 additions & 0 deletions scripts/run_celery_send_sms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions scripts/run_celery_sms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

# runs celery with only the throttled sms sending queue

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

# Check and see if this is running in K8s and if so, wait for cloudwatch agent
if [[ -z "${STATSD_HOST}" ]]; then
init
fi

celery -A run_celery.notify_celery worker --loglevel=INFO --concurrency=1 -Q send-throttled-sms-tasks

0 comments on commit bbb743e

Please sign in to comment.