'Store the result and status of a task.
:param task_id: task id
:param result: The return value of the task, or an exception
instance raised by the task.
:param status: Task status. See
:meth:`celery.result.AsyncResult.get_status` for a list of
possible status values.
:keyword traceback: The traceback at the point of exception (if the
task failed).
:keyword children: List of serialized results of subtasks
of this task.
:keyword exception_retry_count: How many times to retry by
transaction rollback on exception. This could theoretically
happen in a race condition if another worker is trying to
create the same task. The default is to retry twice.'

@transaction_retry(max_retries=2)
def store_result(self, task_id, result, status, traceback=None, children=None):

    return self.update_or_create(task_id=task_id, defaults={u'status': status, u'result': result, u'traceback': traceback, u'meta': {u'children': children}})
