ack late; check rabbitmq
This commit is contained in:
parent
010a3ff267
commit
8e399db587
|
@ -240,6 +240,10 @@ CELERYD_MAX_TASKS_PER_CHILD = 20
|
||||||
# Number of concurrent workers. Defaults to the number of CPUs.
|
# Number of concurrent workers. Defaults to the number of CPUs.
|
||||||
# CELERYD_CONCURRENCY = 8
|
# CELERYD_CONCURRENCY = 8
|
||||||
|
|
||||||
|
# Late ack means the task messages will be acknowledged after
|
||||||
|
# the task has been executed, not just before
|
||||||
|
CELERY_ACKS_LATE = True
|
||||||
|
|
||||||
djcelery.setup_loader()
|
djcelery.setup_loader()
|
||||||
|
|
||||||
# ==============================================
|
# ==============================================
|
||||||
|
|
|
@ -513,6 +513,13 @@ def check_and_run_celery():
|
||||||
if 'pong' in celery_status:
|
if 'pong' in celery_status:
|
||||||
return 'celery is running'
|
return 'celery is running'
|
||||||
|
|
||||||
|
rabbitmq_status = os.popen('telnet localhost 5672').read()
|
||||||
|
if 'Connected' in rabbitmq_status:
|
||||||
|
LOG.info('Rabbitmq is running.')
|
||||||
|
else:
|
||||||
|
LOG.warning('Rabbitmq is not running.')
|
||||||
|
return 'Rabbitmq is not running.'
|
||||||
|
|
||||||
retries = 0
|
retries = 0
|
||||||
while retries < 5:
|
while retries < 5:
|
||||||
LOG.warning('Celery is not running.')
|
LOG.warning('Celery is not running.')
|
||||||
|
|
Loading…
Reference in New Issue