Prechádzať zdrojové kódy

Use bind=true in example

Ask Solem 11 rokov pred
rodič
commit
20ac02664b
1 zmenil súbory, kde vykonal 3 pridanie a 3 odobranie
  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))