浏览代码

Task.bind should always set backend

Ask Solem 11 年之前
父节点
当前提交
f3497541b2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      celery/app/task.py

+ 2 - 2
celery/app/task.py

@@ -294,14 +294,14 @@ class Task(object):
         was_bound, self.__bound__ = self.__bound__, True
         was_bound, self.__bound__ = self.__bound__, True
         self._app = app
         self._app = app
         conf = app.conf
         conf = app.conf
+        self._exec_options = None  # clear option cache
 
 
         for attr_name, config_name in self.from_config:
         for attr_name, config_name in self.from_config:
             if getattr(self, attr_name, None) is None:
             if getattr(self, attr_name, None) is None:
                 setattr(self, attr_name, conf[config_name])
                 setattr(self, attr_name, conf[config_name])
         if self.accept_magic_kwargs is None:
         if self.accept_magic_kwargs is None:
             self.accept_magic_kwargs = app.accept_magic_kwargs
             self.accept_magic_kwargs = app.accept_magic_kwargs
-        if self.backend is None:
-            self.backend = app.backend
+        self.backend = app.backend
 
 
         # decorate with annotations from config.
         # decorate with annotations from config.
         if not was_bound:
         if not was_bound: