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

Method _unregister_worker

gunicorn/dirty/arbiter.py:217–232  ·  view source on GitHub ↗

Unregister a worker's apps when it exits. Removes the worker from all tracking maps. Args: worker_pid: The PID of the worker to unregister

(self, worker_pid)

Source from the content-addressed store, hash-verified

215 self.app_worker_map[app_path].add(worker_pid)
216
217 def _unregister_worker(self, worker_pid):
218 """
219 Unregister a worker's apps when it exits.
220
221 Removes the worker from all tracking maps.
222
223 Args:
224 worker_pid: The PID of the worker to unregister
225 """
226 # Get the apps this worker had
227 app_paths = self.worker_app_map.pop(worker_pid, [])
228
229 # Remove worker from each app's worker set
230 for app_path in app_paths:
231 if app_path in self.app_worker_map:
232 self.app_worker_map[app_path].discard(worker_pid)
233
234 def run(self):
235 """Run the dirty arbiter (blocking call)."""

Callers 2

_cleanup_workerMethod · 0.95

Calls

no outgoing calls