Compare commits
1 Commits
refactor/m
...
gac-x12sa_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c1418a476 |
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user