update compass-celeryd
Change-Id: I2d61d945c599920547e02dfeb9d8901f922a73b9
This commit is contained in:
parent
9da13f2b85
commit
d519f32ebf
@ -18,6 +18,7 @@
|
||||
"""
|
||||
import logging
|
||||
import os.path
|
||||
import urllib
|
||||
|
||||
from compass.utils import setting_wrapper as setting
|
||||
|
||||
@ -26,6 +27,7 @@ CELERY_RESULT_BACKEND = 'amqp://'
|
||||
|
||||
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
|
||||
|
||||
|
||||
CELERY_IMPORTS = ('compass.tasks.tasks',)
|
||||
|
||||
|
||||
|
@ -48,22 +48,22 @@ start() {
|
||||
RETVAL=$?
|
||||
fi
|
||||
echo
|
||||
retries=0
|
||||
max_retries=10
|
||||
output=''
|
||||
while [ $retries -lt $max_retries ]; do
|
||||
output=$(C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status 2&>1)
|
||||
RETVAL=$?
|
||||
if [ "$RETVAL" == "0" ]; then
|
||||
break
|
||||
else
|
||||
sleep 10
|
||||
fi
|
||||
let retries=${retries}+1
|
||||
done
|
||||
if [ "$RETVAL" != "0" ]; then
|
||||
echo output
|
||||
fi
|
||||
# retries=0
|
||||
# max_retries=10
|
||||
# output=''
|
||||
# while [ $retries -lt $max_retries ]; do
|
||||
# output=$(C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status 2&>1)
|
||||
# RETVAL=$?
|
||||
# if [ "$RETVAL" == "0" ]; then
|
||||
# break
|
||||
# else
|
||||
# sleep 10
|
||||
# fi
|
||||
# let retries=${retries}+1
|
||||
# done
|
||||
# if [ "$RETVAL" != "0" ]; then
|
||||
# echo output
|
||||
# fi
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
@ -104,10 +104,10 @@ case "$1" in
|
||||
status -p /var/run/celery-worker.pid $CELERY
|
||||
RETVAL=$?
|
||||
fi
|
||||
if [ "$RETVAL" == "0" ]; then
|
||||
C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status
|
||||
RETVAL=$?
|
||||
fi
|
||||
# if [ "$RETVAL" == "0" ]; then
|
||||
# C_FORCE_ROOT=1 CELERY_CONFIG_MODULE=compass.utils.celeryconfig_wrapper $CELERY status
|
||||
# RETVAL=$?
|
||||
# fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|restart}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user