there is no need to except, just reload in handle_hup method.

This commit is contained in:
benoitc 2010-06-17 17:09:22 +02:00
parent 8b10e33ecd
commit 6ca1a2398e

View File

@ -18,10 +18,6 @@ from gunicorn.pidfile import Pidfile
from gunicorn.sock import create_socket from gunicorn.sock import create_socket
from gunicorn import util from gunicorn import util
class HUPSignal(Exception):
pass
class Arbiter(object): class Arbiter(object):
""" """
Arbiter maintain the workers processes alive. It launches or Arbiter maintain the workers processes alive. It launches or
@ -53,8 +49,6 @@ class Arbiter(object):
def __init__(self, app): def __init__(self, app):
self.setup(app) self.setup(app)
self.log = logging.getLogger(__name__) self.log = logging.getLogger(__name__)
@ -160,8 +154,6 @@ class Arbiter(object):
self.log.info("Handling signal: %s" % signame) self.log.info("Handling signal: %s" % signame)
handler() handler()
self.wakeup() self.wakeup()
except HUPSignal:
self.reload()
except StopIteration: except StopIteration:
self.halt() self.halt()
except KeyboardInterrupt: except KeyboardInterrupt:
@ -182,11 +174,12 @@ class Arbiter(object):
def handle_hup(self): def handle_hup(self):
"""\ """\
HUP handling. HUP handling.
Entirely reloading the application including gracefully - Reload configuration
restart the workers and rereading the configuration. - Start the new worker processes with a new configuration
- Gracefully shutdown the old worker processes
""" """
self.log.info("Hang up: %s" % self.master_name) self.log.info("Hang up: %s" % self.master_name)
raise HUPSignal self.reload()
def handle_quit(self): def handle_quit(self):
"SIGQUIT handling" "SIGQUIT handling"