diff --git a/hyperglass/main.py b/hyperglass/main.py index 3002f3a..50a2110 100644 --- a/hyperglass/main.py +++ b/hyperglass/main.py @@ -118,14 +118,15 @@ def when_ready(server: "Arbiter") -> None: def on_exit(_: t.Any) -> None: """Gunicorn shutdown tasks.""" - log.critical("Stopping hyperglass {}", __version__) - state = use_state() - if not Settings.dev_mode: - state.clear() + state.clear() + + log.info("Cleared hyperglass state") unregister_all_plugins() + log.critical("Stopping hyperglass {}", __version__) + class HyperglassWSGI(BaseApplication): """Custom gunicorn app.""" @@ -185,6 +186,9 @@ def run(_workers: int = None): try: log.debug("System settings: {!r}", Settings) + state = use_state() + state.clear() + init_user_config() workers = 1 if Settings.debug else cpu_count(2)