瀏覽代碼

Documented that retry() raises an exception. Closes #476

Ask Solem 13 年之前
父節點
當前提交
5401038c5e
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      docs/userguide/tasks.rst

+ 10 - 0
docs/userguide/tasks.rst

@@ -138,6 +138,16 @@ is available as the tombstone (result) of the task. When
 exception raised.  However, if an `exc` argument is not provided the
 :exc:`~celery.exceptions.RetryTaskError` exception is raised instead.
 
+.. note::
+
+    The :meth:`retry` call will raise an exception so any code after the retry
+    will not be reached.  This is the :exc:`celery.exceptions.RetryTaskError`
+    exception, it is not handled as an error but rather as a semi-predicate
+    to signify to the worker that the task is to be retried.
+
+    This is normal operation and always happens unless the
+    ``throw`` argument to retry is set to :const:`False`.
+
 .. _task-retry-custom-delay:
 
 Using a custom retry delay