Преглед изворни кода

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

Sam Cooke пре 12 година
родитељ
комит
a372221ba0
1 измењених фајлова са 3 додато и 3 уклоњено
  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)