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:
benoitc 2012-06-18 11:02:30 +02:00
parent da637dfd13
commit a68618c824
2 changed files with 6 additions and 3 deletions

View File

@ -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()

View File

@ -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.