ソースを参照

Cosmetics: celery.app.trace

Ask Solem 8 年 前
コミット
39e8e0fe84
1 ファイル変更4 行追加1 行削除
  1. 4 1
      celery/app/trace.py

+ 4 - 1
celery/app/trace.py

@@ -184,17 +184,20 @@ class TraceInfo(object):
 
     def handle_failure(self, task, req, store_errors=True, call_errbacks=True):
         """Handle exception."""
-        type_, _, tb = sys.exc_info()
+        _, _, tb = sys.exc_info()
         try:
             exc = self.retval
+            # make sure we only send pickleable exceptions back to parent.
             einfo = ExceptionInfo()
             einfo.exception = get_pickleable_exception(einfo.exception)
             einfo.type = get_pickleable_etype(einfo.type)
+
             task.backend.mark_as_failure(
                 req.id, exc, einfo.traceback,
                 request=req, store_result=store_errors,
                 call_errbacks=call_errbacks,
             )
+
             task.on_failure(exc, req.id, req.args, req.kwargs, einfo)
             signals.task_failure.send(sender=task, task_id=req.id,
                                       exception=exc, args=req.args,