Explorar el Código

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

Ask Solem hace 16 años
padre
commit
a19118e6ec
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  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: