Skip to content

Commit 951f8f4

Browse files
committed
support for more custom args to handle the time drift issue on kubernetes
1 parent c30a94a commit 951f8f4

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

run-worker.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,22 @@ if [[ "${SHARED_LOG_CFG}" != "" ]]; then
7777
echo ""
7878
fi
7979

80+
# Use the WORKER_EXTRA_ARGS to pass in specific args:
81+
# http://docs.celeryproject.org/en/latest/reference/celery.bin.worker.html
82+
#
83+
# example args from 4.2.0:
84+
# --without-heartbeat
85+
# --heartbeat-interval N
86+
# --without-gossip
87+
# --without-mingle
88+
8089
if [[ "${num_workers}" == "1" ]]; then
8190
echo "Starting Worker=${worker_module}"
82-
echo "celery worker -A ${worker_module} -c ${num_workers} -l ${log_level} -n ${worker_name} -Q ${custom_queues}"
83-
celery worker -A $worker_module -c ${num_workers} -l ${log_level} -n ${worker_name} -Q $custom_queues
91+
echo "celery worker -A ${worker_module} -c ${num_workers} -l ${log_level} -n ${worker_name} -Q ${custom_queues} ${WORKER_EXTRA_ARGS}"
92+
celery worker -A $worker_module -c ${num_workers} -l ${log_level} -n ${worker_name} -Q $custom_queues ${WORKER_EXTRA_ARGS}
8493
else
8594
echo "Starting Workers=${worker_module}"
86-
echo "celery worker -A ${worker_module} -c ${num_workers} -l ${log_level} -n ${worker_name} --logfile=${log_file} -Q ${custom_queues}"
87-
celery worker -A $worker_module -c ${num_workers} -l ${log_level} -n ${worker_name} --logfile=${log_file} -Q ${custom_queues}
95+
echo "celery worker -A ${worker_module} -c ${num_workers} -l ${log_level} -n ${worker_name} --logfile=${log_file} -Q ${custom_queues} ${WORKER_EXTRA_ARGS}"
96+
celery worker -A $worker_module -c ${num_workers} -l ${log_level} -n ${worker_name} --logfile=${log_file} -Q ${custom_queues} ${WORKER_EXTRA_ARGS}
8897
fi
8998
echo ""

0 commit comments

Comments
 (0)