Skip to content

Commit

Permalink
Squash 2041 - Try sending a variable for CELERY_CONCURRENCY for healt…
Browse files Browse the repository at this point in the history
…h check
  • Loading branch information
MackHalliday committed Nov 21, 2024
1 parent 025dcf1 commit 52de86e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
}
],
"environment": [
{ "name": "CELERY_CONCURRENCY",
"value": 16
},
{
"name": "DD_SERVICE",
"value": "celery"
Expand Down
3 changes: 2 additions & 1 deletion scripts/check_celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ set -e
grep_string="run_celery.notify_celery\ worker"
celery_pid_count=$(ps aux | grep -E run_celery.notify_celery\ worker | grep -v grep | wc -l)

TOTAL_CELERY_PIDS=$((CELERY_CONCURRENCY + 1))

if [ $celery_pid_count -ne 17 ]; then
if [ $celery_pid_count -ne TOTAL_CELERY_PIDS ]; then
echo -e "There are an incorrect number of Celery PIDs: $celery_pid_count"
exit 1
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_celery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e

# Necessary to run as exec so the PID is transferred to Celery for the `SIGTERM` sent from ECS
exec ddtrace-run celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=16
exec ddtrace-run celery -A run_celery.notify_celery worker --pidfile="/tmp/celery.pid" --loglevel=INFO --concurrency=CELERY_CONCURRENCY

0 comments on commit 52de86e

Please sign in to comment.