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)
| 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 | """ |