handle_work_error signature to work

* celery error callback signature isn't well defined. Thus, our error
callback signature is made to handle just about any call signature and
depend on only 1 attribute, id, existing.

See https://github.com/celery/celery/issues/3709
This commit is contained in:
Chris Meyers 2018-01-04 15:23:13 -05:00
parent 815cd829e0
commit f0ff6ecb0a

View File

@ -363,8 +363,9 @@ def handle_work_success(self, result, task_actual):
@shared_task(queue='tower', base=LogErrorsTask)
def handle_work_error(request, exc, traceback, task_id, subtasks=None):
logger.debug('Executing error task id %s, subtasks: %s' % (request.id, str(subtasks)))
def handle_work_error(task_id, *args, **kwargs):
subtasks = kwargs.get('subtasks', None)
logger.debug('Executing error task id %s, subtasks: %s' % (task_id, str(subtasks)))
first_instance = None
first_instance_type = ''
if subtasks is not None: