瀏覽代碼

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)