From ec467234ec21fdeb80241bc9058317355eb5019f Mon Sep 17 00:00:00 2001 From: Kilian Krause Date: Wed, 5 Jul 2023 23:59:51 +0200 Subject: [PATCH] move webui to 5001 to avoid overlap with kea --- src/capport/api/hypercorn_run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/capport/api/hypercorn_run.py b/src/capport/api/hypercorn_run.py index c922fff..294fce6 100644 --- a/src/capport/api/hypercorn_run.py +++ b/src/capport/api/hypercorn_run.py @@ -9,7 +9,8 @@ import capport.config def run(config: hypercorn.config.Config) -> None: sockets = config.create_sockets() - assert config.worker_class == 'trio' + if type(config.worker_class) != 'trio': + raise Exception('Invalid worker class received from constructor') hypercorn.trio.run.trio_worker(config=config, sockets=sockets) @@ -25,6 +26,7 @@ def main() -> None: hypercorn_config = hypercorn.config.Config() hypercorn_config.application_path = 'capport.api.app' hypercorn_config.worker_class = 'trio' + hypercorn_config.bind = ["127.0.0.1:5001"] if _config.server_names: hypercorn_config.server_names = _config.server_names