浏览代码

Added BaseBackend.mark_as_retry to mark the task status as "RETRY" with the
current exception as result.

Ask Solem 16 年之前
父节点
当前提交
a19118e6ec
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      celery/backends/base.py

+ 5 - 0
celery/backends/base.py

@@ -105,6 +105,11 @@ class BaseBackend(object):
         """Mark task as executed with failure. Stores the execption."""
         return self.store_result(task_id, exc, status="FAILURE")
 
+    def mark_as_retry(self, task_id, exc):
+        """Mark task as being retries. Stores the current
+        exception (if any)."""
+        return self.store_result(task_id, exc, status="RETRY")
+
     def create_exception_cls(self, name, module, parent=None):
         """Dynamically create an exception class."""
         if not parent: