mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-01-17 08:48:05 +00:00
improve state handling & logging
This commit is contained in:
parent
9e6e0d55ee
commit
92bc28ac05
1 changed files with 8 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue