Enable code live reload only in debug mode

This commit is contained in:
Julien Duponchelle
2015-01-26 09:51:29 +01:00
parent c409819382
commit 1bfb201368
2 changed files with 5 additions and 3 deletions

View File

@ -164,6 +164,7 @@ class Server:
self._loop.run_until_complete(self._run_application(app, ssl_context))
self._signal_handling()
# FIXME: remove it in production or in tests
self._loop.call_later(1, self._reload_hook)
if server_config["debug"] == "true":
log.info("Code live reload is enabled, watching for file changes")
self._loop.call_later(1, self._reload_hook)
self._loop.run_forever()