فهرست منبع

Fixes typo in result.collect example

Ask Solem 11 سال پیش
والد
کامیت
9fdb6f4d7a
1فایلهای تغییر یافته به همراه7 افزوده شده و 4 حذف شده
  1. 7 4
      celery/result.py

+ 7 - 4
celery/result.py

@@ -166,15 +166,18 @@ class AsyncResult(ResultBase):
 
 
         .. code-block:: python
         .. code-block:: python
 
 
-            @task()
+            from celery import group
+            from proj.celery import app
+
+            @app.task
             def A(how_many):
             def A(how_many):
-                return group(B.s(i) for i in range(how_many))
+                return group(B.s(i) for i in range(how_many))()
 
 
-            @task()
+            @app.task
             def B(i):
             def B(i):
                 return pow2.delay(i)
                 return pow2.delay(i)
 
 
-            @task()
+            @app.task
             def pow2(i):
             def pow2(i):
                 return i ** 2
                 return i ** 2