Enable gunicorn 'reload' mode for debug

When valence API is configured for debug mode, enable gunicorn
'reload' mode, which will restart gunicorn worker for any code
changes.

Change-Id: I15af280a4bd0b1e44429f0bbf45cb2d1398a4d28
Closes-Bug: #1641376
This commit is contained in:
Lin Yang 2016-11-12 21:17:39 -08:00
parent 7e2216219e
commit 656ae59b70

View File

@ -44,7 +44,8 @@ class StandaloneApplication(gunicorn.app.base.BaseApplication):
def main():
options = {
'bind': '%s:%s' % (cfg.bind_host, cfg.bind_port)
'bind': '%s:%s' % (cfg.bind_host, cfg.bind_port),
'reload': cfg.debug
}
StandaloneApplication(application, options).run()
LOG.info(("Valence Server on http://%(host)s:%(port)s"),