Sfoglia il codice sorgente

app.register_task now binds task to app

Ask Solem 8 anni fa
parent
commit
a893527e8b
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      celery/app/base.py

+ 2 - 0
celery/app/base.py

@@ -491,6 +491,8 @@ class Celery(object):
             task.name = self.gen_task_name(
                 task_cls.__name__, task_cls.__module__)
         self.tasks[task.name] = task
+        task._app = self
+        task.bind(self)
         return task
 
     def gen_task_name(self, name, module):