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

Method reload

gunicorn/dirty/arbiter.py:1091–1103  ·  view source on GitHub ↗

Reload workers (SIGHUP handling).

(self)

Source from the content-addressed store, hash-verified

1089 raise
1090
1091 async def reload(self):
1092 """Reload workers (SIGHUP handling)."""
1093 self.log.info("Reloading dirty workers")
1094
1095 # Spawn new workers
1096 for _ in range(self.cfg.dirty_workers):
1097 self.spawn_worker()
1098 await asyncio.sleep(0.1)
1099
1100 # Kill old workers
1101 old_workers = list(self.workers.keys())
1102 for pid in old_workers[self.cfg.dirty_workers:]:
1103 self.kill_worker(pid, signal.SIGTERM)
1104
1105 async def stop(self, graceful=True):
1106 """Stop all workers."""

Callers 2

_signal_handlerMethod · 0.95

Calls 4

spawn_workerMethod · 0.95
kill_workerMethod · 0.95
infoMethod · 0.45
keysMethod · 0.45

Tested by 1