From 76be58dcfa2dcf4f1aa4855c32349302195cd923 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sat, 16 Nov 2019 01:39:03 -0400 Subject: [PATCH] Allow passing the queue list to run_worker Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ docker/rootfs/usr/local/bin/run_worker.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index f19edd83bc..e1d97c0ada 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -153,6 +153,8 @@ Forum topic 1404. - Add "run_command" Docker entrypoint option to run arbitrary Mayan management command. +- Allow specifying the queue list for the run_worker Docker + command. 3.2.10 (2019-XX-XX) =================== diff --git a/docker/rootfs/usr/local/bin/run_worker.sh b/docker/rootfs/usr/local/bin/run_worker.sh index dd5db6068d..5cb0997ea4 100755 --- a/docker/rootfs/usr/local/bin/run_worker.sh +++ b/docker/rootfs/usr/local/bin/run_worker.sh @@ -1,8 +1,12 @@ #!/bin/bash -QUEUE_LIST=`MAYAN_WORKER_NAME=$1 su mayan -c "${MAYAN_PYTHON_BIN_DIR}mayan-edms.py platformtemplate worker_queues"` +export MAYAN_WORKER_NAME=${MAYAN_WORKER_NAME:-$1} + +QUEUE_LIST_DEFAULT=`su mayan -c "${MAYAN_PYTHON_BIN_DIR}mayan-edms.py platformtemplate worker_queues"` + +MAYAN_QUEUE_LIST=${MAYAN_QUEUE_LIST:-${QUEUE_LIST_DEFAULT}} # Use -A and not --app. Both are the same but behave differently # -A can be located before the command while --app cannot. # Pass ${@:2} to allow overriding the defaults arguments -su mayan -c "${MAYAN_PYTHON_BIN_DIR}celery -A mayan worker -Ofair -l ERROR -Q $QUEUE_LIST ${@:2}" +su mayan -c "${MAYAN_PYTHON_BIN_DIR}celery -A mayan worker -Ofair -l ERROR -Q ${MAYAN_QUEUE_LIST} ${@:2}"