MCPcopy
hub / github.com/benoitc/gunicorn / _get_minimum_workers

Method _get_minimum_workers

gunicorn/dirty/arbiter.py:155–170  ·  view source on GitHub ↗

Calculate minimum number of workers required by app specs. Returns the maximum worker_count across all apps that have limits. Apps with worker_count=None don't impose a minimum. Returns: int: Minimum workers required (at least 1)

(self)

Source from the content-addressed store, hash-verified

153 self.app_worker_map[import_path] = set()
154
155 def _get_minimum_workers(self):
156 """
157 Calculate minimum number of workers required by app specs.
158
159 Returns the maximum worker_count across all apps that have limits.
160 Apps with worker_count=None don't impose a minimum.
161
162 Returns:
163 int: Minimum workers required (at least 1)
164 """
165 min_required = 1
166 for spec in self.app_specs.values():
167 worker_count = spec['worker_count']
168 if worker_count is not None:
169 min_required = max(min_required, worker_count)
170 return min_required
171
172 def _get_apps_for_new_worker(self):
173 """

Calls 1

valuesMethod · 0.80