Explorar o código

Always intialize the Task.request context.
Fixes failing test: tests.test_task.test_task.TestCeleryTasks.test_get_logger
(cherry picked from commit 50a33a2714cca8112323581299c1fac8f634ffa6)

Branko Čibej %!s(int64=14) %!d(string=hai) anos
pai
achega
8eeca0a1c7
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      celery/task/base.py

+ 3 - 0
celery/task/base.py

@@ -40,6 +40,9 @@ _default_context = {"logfile": None,
 
 class Context(threading.local):
 
+    def __init__(self):
+        self.update(_default_context)
+
     def update(self, d, **kwargs):
         self.__dict__.update(d, **kwargs)