Files
mayan-edms/docker/rootfs/usr/local/bin/run_worker.sh
Roberto Rosario 76be58dcfa Allow passing the queue list to run_worker
Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
2019-11-16 01:39:03 -04:00

13 lines
516 B
Bash
Executable File

#!/bin/bash
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 ${MAYAN_QUEUE_LIST} ${@:2}"