fix: stabilize Polygon config loading and sync

This commit is contained in:
Repinoid
2026-10-25 10:35:26 +03:00
parent ee35088dae
commit 3df89ec9e7
135 changed files with 6994 additions and 2381 deletions
+9 -1
View File
@@ -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()))