mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
breaking change: take the control on graceful reload back
We really shouldn't allow the people to override the way we spawn the new workers on reload. Graceful is about launching new worker and kill olders after the graceful time.
This commit is contained in:
parent
da637dfd13
commit
a68618c824
@ -359,7 +359,7 @@ class Arbiter(object):
|
||||
self.LISTENER = create_socket(self.cfg, self.log)
|
||||
self.log.info("Listening at: %s", self.LISTENER)
|
||||
|
||||
# spawn new workers with new app & conf
|
||||
# do some actions on reload
|
||||
self.cfg.on_reload(self)
|
||||
|
||||
# unlink pidfile
|
||||
@ -374,6 +374,10 @@ class Arbiter(object):
|
||||
# set new proc_name
|
||||
util._setproctitle("master [%s]" % self.proc_name)
|
||||
|
||||
# spawn new workers
|
||||
for i in range(self.cfg.workers):
|
||||
self.spawn_worker()
|
||||
|
||||
# manage workers
|
||||
self.manage_workers()
|
||||
|
||||
|
||||
@ -867,8 +867,7 @@ class OnReload(Setting):
|
||||
validator = validate_callable(1)
|
||||
type = "callable"
|
||||
def on_reload(server):
|
||||
for i in range(server.app.cfg.workers):
|
||||
server.spawn_worker()
|
||||
pass
|
||||
default = staticmethod(on_reload)
|
||||
desc = """\
|
||||
Called to recycle workers during a reload via SIGHUP.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user