Browse Source

Use bind=true in example

Ask Solem 11 năm trước cách đây
mục cha
commit
20ac02664b
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      examples/django/tasks/__init__.py

+ 3 - 3
examples/django/tasks/__init__.py

@@ -9,6 +9,6 @@ celery.config_from_object(settings)
 celery.autodiscover_tasks(settings.INSTALLED_APPS)
 
 
-@celery.task
-def debug_task():
-    print(repr(debug_task.request))
+@celery.task(bind=True)
+def debug_task(self):
+    print(repr(self.request))