Skip to content

Commit

Permalink
when_ready hook. Called just after the server is started
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitc committed May 22, 2010
1 parent f8fac58 commit 4005614
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gunicorn/arbiter.py
Expand Up @@ -97,7 +97,7 @@ def start(self):
self.pidfile.create(self.pid)
self.log.info("Arbiter booted")
self.log.info("Listening at: %s" % self.LISTENER)

self.cfg.when_ready(self)

def init_signals(self):
"""\
Expand Down
14 changes: 14 additions & 0 deletions gunicorn/config.py
Expand Up @@ -536,3 +536,17 @@ def def_pre_exec(server):
The callable needs to accept a single instance variable for the Arbiter.
""")


with Setting("when_ready") as s:
s.section = "Server Hooks"
s.validator = validate_callable(1)
s.type = "callable"
def def_start_server(server):
pass
s.default = def_start_server
s.fmt_desc("""\
Called just after the server is started
The callable needs to accept a single instance variable for the Arbiter.
""")

0 comments on commit 4005614

Please sign in to comment.