1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-01-17 00:38:06 +00:00

fix missing startup actions; closes #242

This commit is contained in:
thatmattlove 2024-04-02 10:10:03 -04:00
parent 7c398fdf4f
commit fedd0b4196

View file

@ -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)