Explorar o código

Do not replace the request_stack on a task that has already been bound

Sam Cooke %!s(int64=12) %!d(string=hai) anos
pai
achega
a372221ba0
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      celery/app/task.py

+ 3 - 3
celery/app/task.py

@@ -266,9 +266,9 @@ class Task(object):
         if not was_bound:
             self.annotate()
 
-        from celery.utils.threads import LocalStack
-        self.request_stack = LocalStack()
-        self.request_stack.push(Context())
+            from celery.utils.threads import LocalStack
+            self.request_stack = LocalStack()
+            self.request_stack.push(Context())
 
         # PeriodicTask uses this to add itself to the PeriodicTask schedule.
         self.on_bound(app)