(
            self,
            task_id,
            result,
            status,
            traceback=None,
            request=None,
            using=None
    )
return result
Store return value and status of an executed task.
Store return value and status of an executed task.
Store return value and status of an executed task .
def _store_result(
            self,
            task_id,
            result,
            status,
            traceback=None,
            request=None,
            using=None
    ):
        """Store return value and status of an executed task."""
        content_type, content_encoding, result = self.encode_content(result)
        _, _, meta = self.encode_content(
            {'children': self.current_task_children(request)}
        )

        task_name = getattr(request, 'task', None)
        properties = getattr(request, 'properties', {})
        periodic_task_name = properties.get('periodic_task_name', None)
        worker = getattr(request, 'hostname', None)

        # Get input arguments
        if getattr(request, 'argsrepr', None) is not None:
            # task protocol 2
            task_args = request.argsrepr
        else:
            # task protocol 1
            task_args = getattr(request, 'args', None)

        if getattr(request, 'kwargsrepr', None) is not None:
            # task protocol 2
            task_kwargs = request.kwargsrepr
        else:
            # task protocol 1
            task_kwargs = getattr(request, 'kwargs', None)

        # Encode input arguments
        if task_args is not None:
            _, _, task_args = self.encode_content(task_args)

        if task_kwargs is not None:
            _, _, task_kwargs = self.encode_content(task_kwargs)

        self.TaskModel._default_manager.store_result(
            content_type,
            content_encoding,
            task_id,
            result,
            status,
            traceback=traceback,
            meta=meta,
            periodic_task_name=periodic_task_name,
            task_name=task_name,
            task_args=task_args,
            task_kwargs=task_kwargs,
            worker=worker,
            using=using,
        )
        return result
def _store_result ( self , task_id , result , status , traceback = None , request = None , using = None ) : content_type , content_encoding , result = self . encode_content ( result ) _ , _ , meta = self . encode_content ( { 'children' : self . current_task_children ( request ) } ) task_name = getattr ( request , 'task' , None ) properties = getattr ( request , 'properties' , { } ) periodic_task_name = properties . get ( 'periodic_task_name' , None ) worker = getattr ( request , 'hostname' , None ) # Get input arguments if getattr ( request , 'argsrepr' , None ) is not None : # task protocol 2 task_args = request . argsrepr else : # task protocol 1 task_args = getattr ( request , 'args' , None ) if getattr ( request , 'kwargsrepr' , None ) is not None : # task protocol 2 task_kwargs = request . kwargsrepr else : # task protocol 1 task_kwargs = getattr ( request , 'kwargs' , None ) # Encode input arguments if task_args is not None : _ , _ , task_args = self . encode_content ( task_args ) if task_kwargs is not None : _ , _ , task_kwargs = self . encode_content ( task_kwargs ) self . TaskModel . _default_manager . store_result ( content_type , content_encoding , task_id , result , status , traceback = traceback , meta = meta , periodic_task_name = periodic_task_name , task_name = task_name , task_args = task_args , task_kwargs = task_kwargs , worker = worker , using = using , ) return result