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

Method dirty_remove

gunicorn/ctl/handlers.py:329–348  ·  view source on GitHub ↗

Remove dirty workers. Sends a MANAGE message to the dirty arbiter to remove workers. Args: count: Number of dirty workers to remove (default 1) Returns: Dictionary with removed count or error

(self, count: int = 1)

Source from the content-addressed store, hash-verified

327 return self._send_manage_message("add", count)
328
329 def dirty_remove(self, count: int = 1) -> dict:
330 """
331 Remove dirty workers.
332
333 Sends a MANAGE message to the dirty arbiter to remove workers.
334
335 Args:
336 count: Number of dirty workers to remove (default 1)
337
338 Returns:
339 Dictionary with removed count or error
340 """
341 if not self.arbiter.dirty_arbiter_pid:
342 return {
343 "success": False,
344 "error": "Dirty arbiter not running",
345 }
346
347 count = max(1, int(count))
348 return self._send_manage_message("remove", count)
349
350 def _send_manage_message(self, operation: str, count: int) -> dict:
351 """

Callers 3

_handle_dirtyMethod · 0.80

Calls 1

_send_manage_messageMethod · 0.95

Tested by 2