From fedd0b419687811fb45e1880e2872032628163fc Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Tue, 2 Apr 2024 10:10:03 -0400 Subject: [PATCH] fix missing startup actions; closes #242 --- hyperglass/main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hyperglass/main.py b/hyperglass/main.py index c0af8ac..c82d4c3 100644 --- a/hyperglass/main.py +++ b/hyperglass/main.py @@ -1,6 +1,7 @@ -"""Gunicorn Config File.""" +"""Start hyperglass.""" # Standard Library +import asyncio import sys import typing as t import logging @@ -89,6 +90,11 @@ def unregister_all_plugins() -> None: def start(*, log_level: t.Union[str, int], workers: int) -> None: """Start hyperglass via ASGI server.""" + register_all_plugins() + + if not Settings.disable_ui: + asyncio.run(build_ui()) + uvicorn.run( app="hyperglass.api:app", host=str(Settings.host), @@ -173,6 +179,7 @@ def run(workers: int = None): unregister_all_plugins() raise error except (SystemExit, BaseException): + unregister_all_plugins() sys.exit(4)