From 2c739c304148d6672e56e71d6ed27e31dd9c38e5 Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Fri, 10 May 2024 09:21:48 -0400 Subject: [PATCH] fix: logic cleanup --- .../templates/edx/app/edxapp/worker.sh.j2 | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 b/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 index 5354074ec23..748f5a17318 100644 --- a/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2 @@ -4,8 +4,18 @@ {% set edxapp_venv_bin = edxapp_venv_dir + "/bin" %} source {{ edxapp_app_dir }}/edxapp_env +{% set executable = edxapp_venv_bin + '/celery' %} + {% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + edxapp_venv_bin + '/celery' %} +{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + executable %} + +export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini" +if command -v ec2metadata >/dev/null 2>&1; then + INSTANCEID=$(ec2metadata --instance-id); + HOSTNAME=$(hostname) + export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" +fi +{% endif %} {% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %} {% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %} @@ -19,16 +29,6 @@ export DD_TRACE_LOG_STREAM_HANDLER=false export DD_TRACE_PYMONGO_ENABLED=false {% endif -%} -export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini" -if command -v ec2metadata >/dev/null 2>&1; then - INSTANCEID=$(ec2metadata --instance-id); - HOSTNAME=$(hostname) - export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" -fi -{% else %} -{% set executable = edxapp_venv_bin + '/celery' %} -{% endif %} - # We exec so that celery is the child of supervisor and can be managed properly exec {{ executable }} $@