Bladeren bron

Task.bind should always set backend

Ask Solem 11 jaren geleden
bovenliggende
commit
f3497541b2
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  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
         self._app = app
         conf = app.conf
+        self._exec_options = None  # clear option cache
 
         for attr_name, config_name in self.from_config:
             if getattr(self, attr_name, None) is None:
                 setattr(self, attr_name, conf[config_name])
         if self.accept_magic_kwargs is None:
             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.
         if not was_bound: