diff --git a/superset/cli.py b/superset/cli.py index ba143594e7d..e7d4b1a93b0 100755 --- a/superset/cli.py +++ b/superset/cli.py @@ -30,6 +30,10 @@ def init(): @manager.option( '-d', '--debug', action='store_true', help="Start the web server in debug mode") +@manager.option( + '-n', '--no-reload', action='store_false', dest='no_reload', + default=config.get("FLASK_USE_RELOAD"), + help="Don't use the reloader in debug mode") @manager.option( '-a', '--address', default=config.get("SUPERSET_WEBSERVER_ADDRESS"), help="Specify the address to which to bind the web server") @@ -42,7 +46,7 @@ def init(): @manager.option( '-t', '--timeout', default=config.get("SUPERSET_WEBSERVER_TIMEOUT"), help="Specify the timeout (seconds) for the gunicorn web server") -def runserver(debug, address, port, timeout, workers): +def runserver(debug, no_reload, address, port, timeout, workers): """Starts a Superset web server""" debug = debug or config.get("DEBUG") if debug: @@ -50,7 +54,8 @@ def runserver(debug, address, port, timeout, workers): host='0.0.0.0', port=int(port), threaded=True, - debug=True) + debug=True, + use_reloader=no_reload) else: cmd = ( "gunicorn " @@ -117,13 +122,13 @@ def load_examples(load_test_data): @manager.option( '-d', '--datasource', help=( - "Specify which datasource name to load, if omitted, all " - "datasources will be refreshed")) + "Specify which datasource name to load, if omitted, all " + "datasources will be refreshed")) @manager.option( '-m', '--merge', help=( - "Specify using 'merge' property during operation. " - "Default value is False ")) + "Specify using 'merge' property during operation. " + "Default value is False ")) def refresh_druid(datasource, merge): """Refresh druid datasources""" session = db.session() diff --git a/superset/config.py b/superset/config.py index 78064bfc1eb..a3da859abba 100644 --- a/superset/config.py +++ b/superset/config.py @@ -57,6 +57,7 @@ CSRF_ENABLED = True # Whether to run the web server in debug mode or not DEBUG = False +FLASK_USE_RELOAD = True # Whether to show the stacktrace on 500 error SHOW_STACKTRACE = True