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

Method worker_add

gunicorn/ctl/handlers.py:227–248  ·  view source on GitHub ↗

Increase worker count. Args: count: Number of workers to add (default 1) Returns: Dictionary with added count and new total

(self, count: int = 1)

Source from the content-addressed store, hash-verified

225 return {"listeners": listeners, "count": len(listeners)}
226
227 def worker_add(self, count: int = 1) -> dict:
228 """
229 Increase worker count.
230
231 Args:
232 count: Number of workers to add (default 1)
233
234 Returns:
235 Dictionary with added count and new total
236 """
237 count = max(1, int(count))
238 old_count = self.arbiter.num_workers
239 self.arbiter.num_workers += count
240
241 # Wake up the arbiter to spawn workers
242 self.arbiter.wakeup()
243
244 return {
245 "added": count,
246 "previous": old_count,
247 "total": self.arbiter.num_workers,
248 }
249
250 def worker_remove(self, count: int = 1) -> dict:
251 """

Callers 3

_handle_workerMethod · 0.80

Calls 1

wakeupMethod · 0.45

Tested by 2