Browse Source

Doc wording

Ask Solem 10 years ago
parent
commit
92b1d07bd7
1 changed files with 8 additions and 8 deletions
  1. 8 8
      celery/app/task.py

+ 8 - 8
celery/app/task.py

@@ -483,11 +483,12 @@ class Task(object):
         :keyword retry: If enabled sending of the task message will be retried
         :keyword retry: If enabled sending of the task message will be retried
                         in the event of connection loss or failure.  Default
                         in the event of connection loss or failure.  Default
                         is taken from the :setting:`CELERY_TASK_PUBLISH_RETRY`
                         is taken from the :setting:`CELERY_TASK_PUBLISH_RETRY`
-                        setting.  Note you need to handle the
+                        setting.  Note that you need to handle the
                         producer/connection manually for this to work.
                         producer/connection manually for this to work.
 
 
         :keyword retry_policy:  Override the retry policy used.  See the
         :keyword retry_policy:  Override the retry policy used.  See the
-                                :setting:`CELERY_TASK_PUBLISH_RETRY` setting.
+                                :setting:`CELERY_TASK_PUBLISH_RETRY_POLICY`
+                                setting.
 
 
         :keyword routing_key: Custom routing key used to route the task to a
         :keyword routing_key: Custom routing key used to route the task to a
                               worker server. If in combination with a
                               worker server. If in combination with a
@@ -624,14 +625,14 @@ class Task(object):
             >>> from imaginary_twitter_lib import Twitter
             >>> from imaginary_twitter_lib import Twitter
             >>> from proj.celery import app
             >>> from proj.celery import app
 
 
-            >>> @app.task()
-            ... def tweet(auth, message):
+            >>> @app.task(bind=True)
+            ... def tweet(self, auth, message):
             ...     twitter = Twitter(oauth=auth)
             ...     twitter = Twitter(oauth=auth)
             ...     try:
             ...     try:
             ...         twitter.post_status_update(message)
             ...         twitter.post_status_update(message)
             ...     except twitter.FailWhale as exc:
             ...     except twitter.FailWhale as exc:
             ...         # Retry in 5 minutes.
             ...         # Retry in 5 minutes.
-            ...         raise tweet.retry(countdown=60 * 5, exc=exc)
+            ...         raise self.retry(countdown=60 * 5, exc=exc)
 
 
         Although the task will never return above as `retry` raises an
         Although the task will never return above as `retry` raises an
         exception to notify the worker, we use `raise` in front of the retry
         exception to notify the worker, we use `raise` in front of the retry
@@ -863,9 +864,8 @@ class Task(object):
         :param status: Current task state.
         :param status: Current task state.
         :param retval: Task return value/exception.
         :param retval: Task return value/exception.
         :param task_id: Unique id of the task.
         :param task_id: Unique id of the task.
-        :param args: Original arguments for the task that failed.
-        :param kwargs: Original keyword arguments for the task
-                       that failed.
+        :param args: Original arguments for the task.
+        :param kwargs: Original keyword arguments for the task.
 
 
         :keyword einfo: :class:`~billiard.einfo.ExceptionInfo`
         :keyword einfo: :class:`~billiard.einfo.ExceptionInfo`
                         instance, containing the traceback (if any).
                         instance, containing the traceback (if any).