ソースを参照

Update outdated control command example. Closes #1680

Ask Solem 11 年 前
コミット
7465b6026e
1 ファイル変更4 行追加4 行削除
  1. 4 4
      docs/userguide/workers.rst

+ 4 - 4
docs/userguide/workers.rst

@@ -1088,13 +1088,13 @@ they take a single argument: the current
 From there you have access to the active
 :class:`~celery.worker.consumer.Consumer` if needed.
 
-Here's an example control command that restarts the broker connection:
+Here's an example control command that increments the task prefetch count:
 
 .. code-block:: python
 
     from celery.worker.control import Panel
 
     @Panel.register
-    def reset_connection(state):
-        state.consumer.reset_connection()
-        return {'ok': 'connection reset'}
+    def increase_prefetch_count(state, n=1):
+        state.consumer.qos.increment_eventually(n)
+        return {'ok': 'prefetch count incremented'}