fix: preserve follower timing at state write

This commit is contained in:
Codex
2026-07-03 17:21:15 +00:00
parent 2dfc267369
commit cf9454d274
2 changed files with 62 additions and 1 deletions
@@ -0,0 +1,16 @@
import { execFileSync } from "node:child_process";
const namespace = process.env.NAMESPACE || "";
const configMap = process.env.CONFIGMAP || "";
const followerId = process.env.FOLLOWER_ID || "";
try {
const raw = execFileSync("kubectl", ["-n", namespace, "get", "configmap", configMap, "-o", "json"], {
encoding: "utf8",
stdio: ["ignore", "pipe", "pipe"],
});
const data = JSON.parse(raw).data || {};
process.stdout.write(data[followerId] || "{}");
} catch {
process.stdout.write("{}");
}