2014-01-06 19:49:32 +04:00
|
|
|
#!/bin/bash
|
2014-05-31 03:09:11 +04:00
|
|
|
curr_dir=$( dirname "${BASH_SOURCE[0]}" )
|
|
|
|
cd $( dirname $curr_dir)
|
2014-01-08 01:28:48 +04:00
|
|
|
|
2014-05-31 03:09:11 +04:00
|
|
|
source /etc/profile.d/treeherder.sh
|
2014-05-20 19:57:13 +04:00
|
|
|
|
2014-05-31 03:09:11 +04:00
|
|
|
if [[ ${NEW_RELIC_LICENSE_KEY+isset} = isset ]]; then
|
2014-05-20 19:57:13 +04:00
|
|
|
NEWRELIC_ADMIN="newrelic-admin run-program"
|
2014-05-31 03:09:11 +04:00
|
|
|
fi
|
2014-05-20 19:57:13 +04:00
|
|
|
|
2014-05-31 03:17:42 +04:00
|
|
|
if [ -f ../venv/bin/python ]; then
|
2014-05-30 21:29:34 +04:00
|
|
|
source ../venv/bin/activate
|
|
|
|
PYTHON=../venv/bin/python
|
2014-05-31 03:09:11 +04:00
|
|
|
else
|
2014-05-30 21:29:34 +04:00
|
|
|
PYTHON=python
|
2014-05-31 03:09:11 +04:00
|
|
|
fi
|
2014-05-30 21:29:34 +04:00
|
|
|
|
2014-05-31 03:09:11 +04:00
|
|
|
LOGFILE=/var/log/celery/celery_worker.log
|
|
|
|
|
2014-05-31 03:24:20 +04:00
|
|
|
if [ ! -f $LOGFILE ]; then
|
2014-05-31 03:09:11 +04:00
|
|
|
touch $LOGFILE
|
|
|
|
fi
|
|
|
|
|
2014-10-07 02:40:46 +04:00
|
|
|
exec $NEWRELIC_ADMIN $PYTHON manage.py celeryd -c 3 -Q default,buildapi,pushlog -E --maxtasksperchild=500 --logfile=$LOGFILE -l INFO
|