Browse Source

Fix documentation restructured text errors

Ask Solem 15 years ago
parent
commit
515bd376e2
3 changed files with 21 additions and 11 deletions
  1. 2 1
      Changelog
  2. 17 10
      FAQ
  3. 2 0
      docs/tutorials/otherqueues.rst

+ 2 - 1
Changelog

@@ -189,7 +189,8 @@ CHANGES
 BUGS
 ----
 
-* Fixed a race condition when storing task results in the database.
+* Fixed a race condition that could happen while storing task results in the
+  database.
 
 DOCUMENTATION
 -------------

+ 17 - 10
FAQ

@@ -297,9 +297,9 @@ Say you have two servers, ``x``, and ``y`` that handles regular tasks,
 and one server ``z``, that only handles feed related tasks, you can use this
 configuration:
 
-    * Servers ``x`` and ``y``: settings.py:
+* Servers ``x`` and ``y``: settings.py:
 
-    .. code-block:: python
+.. code-block:: python
 
     CELERY_DEFAULT_QUEUE = "regular_tasks"
     CELERY_QUEUES = {
@@ -307,13 +307,13 @@ configuration:
             "binding_key": "task.#",
         },
     }
-        CELERY_DEFAULT_EXCHANGE = "tasks"
-        CELERY_DEFAULT_EXCHANGE_TYPE = "topic"
-        CELERY_DEFAULT_ROUTING_KEY = "task.regular"
+    CELERY_DEFAULT_EXCHANGE = "tasks"
+    CELERY_DEFAULT_EXCHANGE_TYPE = "topic"
+    CELERY_DEFAULT_ROUTING_KEY = "task.regular"
 
-    * Server ``z``: settings.py:
+* Server ``z``: settings.py:
 
-    .. code-block:: python
+.. code-block:: python
 
         CELERY_DEFAULT_QUEUE = "feed_tasks"
         CELERY_QUEUES = {
@@ -335,13 +335,20 @@ Now to make a Task run on the ``z`` server you need to set its
 .. code-block:: python
 
     from feedaggregator.models import Feed
-    from celery.task import Task
+    from celery.decorators import task
+
+    @task(routing_key="feed.importer")
+    def import_feed(feed_url):
+        Feed.objects.import_feed(feed_url)
+
+or if subclassing the ``Task`` class directly:
+
+.. code-block:: python
 
     class FeedImportTask(Task):
         routing_key = "feed.importer"
 
         def run(self, feed_url):
-            # something importing the feed
             Feed.objects.import_feed(feed_url)
 
 
@@ -376,7 +383,7 @@ just specify a custom exchange and exchange type:
 
 .. code-block:: python
 
-CELERY_QUEUES = {
+    CELERY_QUEUES = {
             "feed_tasks": {
                 "binding_key": "feed.#",
             },

+ 2 - 0
docs/tutorials/otherqueues.rst

@@ -81,6 +81,8 @@ name of the exchange to be the same as the queue::
 
 or in a custom queue-mapping:
 
+.. code-block:: python
+
     CELERY_QUEUES = {
         "tasks": {"exchange": "tasks"},
         "feeds": {"exchange": "feeds"},