mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Add a --live options to control livereload
Because the livereload bug due to timezone issues with Vagrant
This commit is contained in:
parent
ebc214d6fa
commit
4689024b50
@ -91,6 +91,7 @@ def parse_arguments(argv, config):
|
||||
"allow": config.getboolean("allow_remote_console", False),
|
||||
"quiet": config.getboolean("quiet", False),
|
||||
"debug": config.getboolean("debug", False),
|
||||
"live": config.getboolean("live", False),
|
||||
}
|
||||
|
||||
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("-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("-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)
|
||||
|
||||
|
@ -173,7 +173,7 @@ class Server:
|
||||
self._loop.run_until_complete(self._run_application(app, ssl_context))
|
||||
self._signal_handling()
|
||||
|
||||
if server_config.getboolean("debug"):
|
||||
if server_config.getboolean("live"):
|
||||
log.info("Code live reload is enabled, watching for file changes")
|
||||
self._loop.call_later(1, self._reload_hook)
|
||||
self._loop.run_forever()
|
||||
|
Loading…
Reference in New Issue
Block a user