瀏覽代碼

Don't use map for grow

Ask Solem 16 年之前
父節點
當前提交
d083a48b7d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      celery/pool.py

+ 1 - 1
celery/pool.py

@@ -62,7 +62,7 @@ class DynamicPool(Pool):
 
     def grow(self, size=1):
         """Add ``size`` new workers to the pool."""
-        map(self.add_worker, range(size))
+        [self.add_worker() for i in range(size)]
 
     def is_dead(self, process):
         # First try to see if the process is actually running,