mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Fix an issue with handler tasks after celery upgrade
There's a bug in celery 4.X when using bound tasks as error handlers. We don't actually need it to be bound especially since the request object is now available in the function signature
This commit is contained in:
@@ -357,9 +357,9 @@ def handle_work_success(self, result, task_actual):
|
|||||||
run_job_complete.delay(instance.id)
|
run_job_complete.delay(instance.id)
|
||||||
|
|
||||||
|
|
||||||
@shared_task(bind=True, queue='tower', base=LogErrorsTask)
|
@shared_task(queue='tower', base=LogErrorsTask)
|
||||||
def handle_work_error(self, task_id, subtasks=None):
|
def handle_work_error(request, exc, traceback, task_id, subtasks=None):
|
||||||
logger.debug('Executing error task id %s, subtasks: %s' % (str(self.request.id), str(subtasks)))
|
logger.debug('Executing error task id %s, subtasks: %s' % (request.id, str(subtasks)))
|
||||||
first_instance = None
|
first_instance = None
|
||||||
first_instance_type = ''
|
first_instance_type = ''
|
||||||
if subtasks is not None:
|
if subtasks is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user