From 6ca1a2398ee00da7899226fc33155a688123d99c Mon Sep 17 00:00:00 2001 From: benoitc Date: Thu, 17 Jun 2010 17:09:22 +0200 Subject: [PATCH] there is no need to except, just reload in handle_hup method. --- gunicorn/arbiter.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index a1e8f793..8ff5740d 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -18,10 +18,6 @@ from gunicorn.pidfile import Pidfile from gunicorn.sock import create_socket from gunicorn import util - -class HUPSignal(Exception): - pass - class Arbiter(object): """ Arbiter maintain the workers processes alive. It launches or @@ -53,8 +49,6 @@ class Arbiter(object): def __init__(self, app): self.setup(app) - - self.log = logging.getLogger(__name__) @@ -160,8 +154,6 @@ class Arbiter(object): self.log.info("Handling signal: %s" % signame) handler() self.wakeup() - except HUPSignal: - self.reload() except StopIteration: self.halt() except KeyboardInterrupt: @@ -182,11 +174,12 @@ class Arbiter(object): def handle_hup(self): """\ HUP handling. - Entirely reloading the application including gracefully - restart the workers and rereading the configuration. + - Reload 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) - raise HUPSignal + self.reload() def handle_quit(self): "SIGQUIT handling"