fix: stabilize Polygon config loading and sync
This commit is contained in:
@@ -21,6 +21,14 @@ import yaml
|
||||
|
||||
_YAML_EXTS = (".yaml", ".yml")
|
||||
_DEFAULT_SERVICES_DIR = "services"
|
||||
_SITE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
|
||||
def _resolve_services_dir(services_dir):
|
||||
"""Resolve configured relative paths from site/, independent of process CWD."""
|
||||
if not os.path.isabs(services_dir):
|
||||
services_dir = os.path.join(_SITE_DIR, services_dir)
|
||||
return os.path.abspath(services_dir)
|
||||
|
||||
|
||||
def _load_one(services_dir):
|
||||
@@ -69,7 +77,7 @@ else:
|
||||
|
||||
STANDS = {}
|
||||
for _sid, _sdir in _stand_dirs.items():
|
||||
_svc, _ops = _load_one(_sdir)
|
||||
_svc, _ops = _load_one(_resolve_services_dir(_sdir))
|
||||
STANDS[_sid] = {"SERVICES": _svc, "OPS_INDEX": _ops}
|
||||
|
||||
DEFAULT_STAND = next(iter(STANDS.keys()))
|
||||
|
||||
Reference in New Issue
Block a user