From dcfe8253465d5e43a2d3a33cfa0bc853fb879c6d Mon Sep 17 00:00:00 2001 From: Philip Cristiano Date: Thu, 20 Jun 2013 19:40:03 -0400 Subject: [PATCH] Rename post_init for greater clarity Makes sense if you saw what it does, less if you just read the config option. --- docs/source/settings.rst | 4 ++-- gunicorn/config.py | 8 ++++---- gunicorn/workers/base.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/settings.rst b/docs/source/settings.rst index f4705267..be4b01a8 100644 --- a/docs/source/settings.rst +++ b/docs/source/settings.rst @@ -561,12 +561,12 @@ Called just after a worker has been forked. The callable needs to accept two instance variables for the Arbiter and new Worker. -post_init +post_worker_init ~~~~~~~~~ * :: - def post_init(worker): + def post_worker_init(worker): pass Called just after a worker has initialized the application. diff --git a/gunicorn/config.py b/gunicorn/config.py index 4e084418..28d3c086 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -1162,16 +1162,16 @@ class Postfork(Setting): """ -class PostInit(Setting): - name = "post_init" +class PostWorkerInit(Setting): + name = "post_worker_init" section = "Server Hooks" validator = validate_callable(1) type = six.callable - def post_init(worker): + def post_worker_init(worker): pass - default = staticmethod(post_init) + default = staticmethod(post_worker_init) desc = """\ Called just after a worker has initialized the application. diff --git a/gunicorn/workers/base.py b/gunicorn/workers/base.py index da719226..945ef024 100644 --- a/gunicorn/workers/base.py +++ b/gunicorn/workers/base.py @@ -99,7 +99,7 @@ class Worker(object): self.wsgi = self.app.wsgi() - self.cfg.post_init(self) + self.cfg.post_worker_init(self) # Enter main run loop self.booted = True