1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Add a --live options to control livereload

Because the livereload bug due to timezone issues with Vagrant
This commit is contained in:
Julien Duponchelle 2015-02-12 16:25:55 +01:00
parent ebc214d6fa
commit 4689024b50
2 changed files with 5 additions and 2 deletions

View File

@ -91,6 +91,7 @@ def parse_arguments(argv, config):
"allow": config.getboolean("allow_remote_console", False), "allow": config.getboolean("allow_remote_console", False),
"quiet": config.getboolean("quiet", False), "quiet": config.getboolean("quiet", False),
"debug": config.getboolean("debug", False), "debug": config.getboolean("debug", False),
"live": config.getboolean("live", False),
} }
parser = argparse.ArgumentParser(description="GNS3 server version {}".format(__version__)) parser = argparse.ArgumentParser(description="GNS3 server version {}".format(__version__))
@ -104,7 +105,9 @@ def parse_arguments(argv, config):
parser.add_argument("-L", "--local", action="store_true", help="local mode (allows some insecure operations)") parser.add_argument("-L", "--local", action="store_true", help="local mode (allows some insecure operations)")
parser.add_argument("-A", "--allow", action="store_true", help="allow remote connections to local console ports") parser.add_argument("-A", "--allow", action="store_true", help="allow remote connections to local console ports")
parser.add_argument("-q", "--quiet", action="store_true", help="do not show logs on stdout") parser.add_argument("-q", "--quiet", action="store_true", help="do not show logs on stdout")
parser.add_argument("-d", "--debug", action="store_true", help="show debug logs and enable code live reload") parser.add_argument("-d", "--debug", action="store_true", help="show debug logs")
parser.add_argument("--live", action="store_true", help="enable code live reload")
return parser.parse_args(argv) return parser.parse_args(argv)

View File

@ -173,7 +173,7 @@ class Server:
self._loop.run_until_complete(self._run_application(app, ssl_context)) self._loop.run_until_complete(self._run_application(app, ssl_context))
self._signal_handling() self._signal_handling()
if server_config.getboolean("debug"): if server_config.getboolean("live"):
log.info("Code live reload is enabled, watching for file changes") log.info("Code live reload is enabled, watching for file changes")
self._loop.call_later(1, self._reload_hook) self._loop.call_later(1, self._reload_hook)
self._loop.run_forever() self._loop.run_forever()