fix: stabilize Polygon config loading and sync
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user