fix(sync): atomic token push with backup, no truncated pool on ssh drop

This commit is contained in:
ENI
2026-11-07 14:04:10 +03:00
parent 0e68513e1b
commit 68942cffb8
+3 -1
View File
@@ -47,7 +47,9 @@ def main():
uniq.append(r)
payload = "\n".join(json.dumps(r, ensure_ascii=False) for r in uniq) + "\n"
rc, out, err = sh(["ssh", "-o", "BatchMode=yes", "-o", "StrictHostKeyChecking=no", PROD,
"cat > %s && systemctl restart minara-shim && sleep 2 && curl -s -m 10 http://127.0.0.1:48140/health" % REMOTE],
("cp -f %s %s.bak 2>/dev/null; cat > %s.tmp && mv -f %s.tmp %s && "
"systemctl restart minara-shim && sleep 2 && "
"curl -s -m 10 http://127.0.0.1:48140/health") % (REMOTE, REMOTE, REMOTE, REMOTE, REMOTE)],
inp=payload)
print("local=%d remote_before=%s rc=%d %s %s" % (len(uniq), remote_n, rc, out[:200], err))