瀏覽代碼

app.register_task now binds task to app

Ask Solem 8 年之前
父節點
當前提交
a893527e8b
共有 1 個文件被更改,包括 2 次插入0 次删除
  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):