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
+12
View File
@@ -309,6 +309,7 @@ def main():
converted = 0
errors = 0
converted_names = set()
for fname in yaml_files:
src = os.path.join(stands_dir, fname)
@@ -328,6 +329,7 @@ def main():
sort_keys=False,
width=200,
)
converted_names.add(fname)
# Быстрая проверка результата
svc_name = cfg.get("name", "?")
@@ -343,6 +345,16 @@ def main():
print(f" FAIL {fname}: {e}")
errors += 1
if errors == 0:
stale_yaml = sorted(
fname
for fname in os.listdir(services_dir)
if fname.lower().endswith(YAML_EXTS) and fname not in converted_names
)
for fname in stale_yaml:
os.remove(os.path.join(services_dir, fname))
print(f" REMOVE {fname}: not present in source")
print()
print(f"Done: {converted} converted, {errors} errors")