From 69795a1c33c60f86e4c9399bd322cd39bff80f41 Mon Sep 17 00:00:00 2001 From: sowmyasri Date: Wed, 31 Jul 2024 15:01:23 +0200 Subject: [PATCH] fixed the function exxecution during import --- fedn/network/api/gunicorn_app.py | 2 ++ fedn/network/api/server.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fedn/network/api/gunicorn_app.py b/fedn/network/api/gunicorn_app.py index c5ffe22dc..f6feb3803 100644 --- a/fedn/network/api/gunicorn_app.py +++ b/fedn/network/api/gunicorn_app.py @@ -22,3 +22,5 @@ def run_gunicorn(app, workers=4): "workers": workers, } GunicornApp(app, options).run() +if __name__ == "main": + run_gunicorn() diff --git a/fedn/network/api/server.py b/fedn/network/api/server.py index 3ab8ecf3e..2774f34d3 100644 --- a/fedn/network/api/server.py +++ b/fedn/network/api/server.py @@ -7,7 +7,7 @@ from fedn.network.api.interface import API from fedn.network.api.shared import control, statestore from fedn.network.api.v1 import _routes -from fedn.network.api.gunicorn_app import run_gunicorn +import gunicorn_app custom_url_prefix = os.environ.get("FEDN_CUSTOM_URL_PREFIX", False) # statestore_config,modelstorage_config,network_id,control=set_statestore_config() @@ -636,6 +636,6 @@ def start_server_api(): if debug: app.run(debug=debug, port=port, host=host) else: - run_gunicorn(app) + gunicorn_app.run_gunicorn(app) if __name__ == "__main__": start_server_api()