treeherder/bin/run_celery_worker_gevent

32 строки
853 B
Bash
Executable File

#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
curr_dir=$( dirname "${BASH_SOURCE[0]}" )
cd $( dirname $curr_dir)
source /etc/profile.d/treeherder.sh
if [[ ${NEW_RELIC_LICENSE_KEY+isset} = isset ]]; then
NEWRELIC_ADMIN="newrelic-admin run-program"
fi
if [ -f ../venv/bin/celery ]; then
source ../venv/bin/activate
CELERY=../venv/bin/celery
else
CELERY=celery
fi
LOGFILE=/var/log/celery/celery_worker_gevent.log
if [ ! -f $LOGFILE ]; then
touch $LOGFILE
fi
exec $NEWRELIC_ADMIN $CELERY -A treeherder worker \
-Q log_parser_fail,log_parser,log_parser_hp -P gevent \
--concurrency=10 --logfile=$LOGFILE -l INFO \
--maxtasksperchild=500 -n log_parser.%h