Ask Solem il y a 9 ans
Parent
commit
2ed53953b0

+ 3 - 1
celery/concurrency/base.py

@@ -159,7 +159,9 @@ class BasePool(object):
                              **options)
 
     def _get_info(self):
-        return {}
+        return {
+            'max-concurrency': self.limit,
+        }
 
     @property
     def info(self):

+ 0 - 5
celery/concurrency/gevent.py

@@ -121,8 +121,3 @@ 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

+ 3 - 1
celery/tests/concurrency/test_concurrency.py

@@ -107,7 +107,9 @@ class test_BasePool(AppCase):
         BasePool(10).on_apply()
 
     def test_interface_info(self):
-        self.assertDictEqual(BasePool(10).info, {})
+        self.assertDictEqual(BasePool(10).info, {
+            'max-concurrency': 10,
+        })
 
     def test_interface_flush(self):
         self.assertIsNone(BasePool(10).flush())