浏览代码

Breaks after changes to billiard

Ask Solem 9 年之前
父节点
当前提交
20489c556e
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      celery/concurrency/asynpool.py

+ 4 - 2
celery/concurrency/asynpool.py

@@ -404,8 +404,10 @@ class AsynPool(_pool.Pool):
             # as processes are recycled, or found lost elsewhere.
             self._fileno_to_outq[proc.outqR_fd] = proc
             self._fileno_to_synq[proc.synqW_fd] = proc
-        self.on_soft_timeout = self._timeout_handler.on_soft_timeout
-        self.on_hard_timeout = self._timeout_handler.on_hard_timeout
+        self.on_soft_timeout = self.on_hard_timeout = None
+        if self._timeout_handler:
+            self.on_soft_timeout = self._timeout_handler.on_soft_timeout
+            self.on_hard_timeout = self._timeout_handler.on_hard_timeout
 
     def _event_process_exit(self, hub, fd):
         # This method is called whenever the process sentinel is readable.