Browse Source

Update gevent.py

Return missing information about pool size. This will allow to get pool size via `control.inspect().stats()`. `eventlet`, `prefork` and `solo` implementations already have this. This is essential to have such feature, for example, to know how much tasks a single pool can consume at one time.
Alexander Oblovatniy 9 năm trước cách đây
mục cha
commit
d07fb545df
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      celery/concurrency/gevent.py

+ 5 - 0
celery/concurrency/gevent.py

@@ -121,3 +121,8 @@ class TaskPool(BasePool):
     @property
     def num_processes(self):
         return len(self._pool)
+        
+    def _get_info(self):
+        info = super(TaskPool, self)._get_info()
+        info['max-concurrency'] = self.limit
+        return info