mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Rename post_init for greater clarity
Makes sense if you saw what it does, less if you just read the config option.
This commit is contained in:
parent
ef6f831971
commit
dcfe825346
@ -561,12 +561,12 @@ Called just after a worker has been forked.
|
|||||||
The callable needs to accept two instance variables for the Arbiter and
|
The callable needs to accept two instance variables for the Arbiter and
|
||||||
new Worker.
|
new Worker.
|
||||||
|
|
||||||
post_init
|
post_worker_init
|
||||||
~~~~~~~~~
|
~~~~~~~~~
|
||||||
|
|
||||||
* ::
|
* ::
|
||||||
|
|
||||||
def post_init(worker):
|
def post_worker_init(worker):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
Called just after a worker has initialized the application.
|
Called just after a worker has initialized the application.
|
||||||
|
|||||||
@ -1162,16 +1162,16 @@ class Postfork(Setting):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class PostInit(Setting):
|
class PostWorkerInit(Setting):
|
||||||
name = "post_init"
|
name = "post_worker_init"
|
||||||
section = "Server Hooks"
|
section = "Server Hooks"
|
||||||
validator = validate_callable(1)
|
validator = validate_callable(1)
|
||||||
type = six.callable
|
type = six.callable
|
||||||
|
|
||||||
def post_init(worker):
|
def post_worker_init(worker):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
default = staticmethod(post_init)
|
default = staticmethod(post_worker_init)
|
||||||
desc = """\
|
desc = """\
|
||||||
Called just after a worker has initialized the application.
|
Called just after a worker has initialized the application.
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ class Worker(object):
|
|||||||
|
|
||||||
self.wsgi = self.app.wsgi()
|
self.wsgi = self.app.wsgi()
|
||||||
|
|
||||||
self.cfg.post_init(self)
|
self.cfg.post_worker_init(self)
|
||||||
|
|
||||||
# Enter main run loop
|
# Enter main run loop
|
||||||
self.booted = True
|
self.booted = True
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user