Compare commits

...

1 Commits

Author SHA1 Message Date
gac-x12sa
0c1418a476 fix: fix startup service config 2025-07-10 18:22:40 +02:00

View File

@@ -6,7 +6,7 @@ is started. It can be used to add additional command line arguments.
import os
from bec_lib.service_config import ServiceConfig
import yaml
import csaxs_bec
@@ -27,6 +27,11 @@ def get_config() -> ServiceConfig:
deployment_path = os.path.dirname(os.path.dirname(os.path.dirname(csaxs_bec.__file__)))
files = os.listdir(deployment_path)
if "bec_config.yaml" in files:
return ServiceConfig(config_path=os.path.join(deployment_path, "bec_config.yaml"))
config_path = os.path.join(deployment_path, "bec_config.yaml")
with open(config_path, "r", encoding="utf-8") as f:
config = yaml.safe_load(f)
config["service_config"]["log_writer"]["base_path"] = os.path.expanduser("~/.bec")
return ServiceConfig(config=config)
else:
return ServiceConfig(redis={"host": "localhost", "port": 6379})