From d6560726c51fad7225477d9fc55677cb6386f2f1 Mon Sep 17 00:00:00 2001 From: Phil Schanely Date: Thu, 4 Aug 2011 13:04:50 -0400 Subject: [PATCH] New on_reload server hook to customize how SIGHUPs spawn new workers. --- doc/htdocs/configure.html | 15 +++++++++++++++ gunicorn/arbiter.py | 14 ++++++-------- gunicorn/config.py | 15 +++++++++++++++ gunicorn/workers/workertmp.py | 3 +++ 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/doc/htdocs/configure.html b/doc/htdocs/configure.html index f7df8dfa..cb4c4084 100644 --- a/doc/htdocs/configure.html +++ b/doc/htdocs/configure.html @@ -448,6 +448,21 @@ def start_server(server):

Called just after the server is started.

The callable needs to accept a single instance variable for the Arbiter.

+
+

on_reload

+ +

Called during a reload from a SIGHUP signal. +This callback should create an appropriate number of new workers. +Old workers will be killed automatically by gunicorn, so it is not required to do so here.

+

The callable needs to accept a single instance variable for the Arbiter.

+

pre_fork