Update celery environ and tasks

This commit is contained in:
Wayne Witzel III
2017-11-09 17:21:19 -05:00
parent de376292ba
commit 14c5123fda
6 changed files with 61 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
import logging
# Celery
from celery import Task, task
from celery import Task, shared_task
# AWX
from awx.main.scheduler import TaskManager
@@ -21,17 +21,17 @@ class LogErrorsTask(Task):
super(LogErrorsTask, self).on_failure(exc, task_id, args, kwargs, einfo)
@task
@shared_task
def run_job_launch(job_id):
TaskManager().schedule()
@task
@shared_task
def run_job_complete(job_id):
TaskManager().schedule()
@task(base=LogErrorsTask)
@shared_task(base=LogErrorsTask)
def run_task_manager():
logger.debug("Running Tower task manager.")
TaskManager().schedule()