implement celery failure logging using CELERY_ANNOTATIONS

see: https://github.com/ansible/awx/issues/1720
see: https://github.com/ansible/tower/issues/1190
This commit is contained in:
Ryan Petrello
2018-04-05 10:43:19 -04:00
parent 1d26c2feb0
commit 4c0096a524
3 changed files with 38 additions and 31 deletions

View File

@@ -469,6 +469,16 @@ CELERY_QUEUES = (
)
CELERY_ROUTES = {}
def log_celery_failure(*args):
# Import annotations lazily to avoid polluting the `awx.settings` namespace
# and causing circular imports
from awx.main.tasks import log_celery_failure
return log_celery_failure(*args)
CELERY_ANNOTATIONS = {'*': {'on_failure': log_celery_failure}}
CELERYBEAT_SCHEDULER = 'celery.beat.PersistentScheduler'
CELERYBEAT_MAX_LOOP_INTERVAL = 60
CELERYBEAT_SCHEDULE = {