Files
boss/local-agent/heartbeat-error-state.mjs
2026-06-08 12:22:50 +08:00

16 lines
469 B
JavaScript

export function recordHeartbeatRunnerError(runtime, error) {
const body = error instanceof Error ? error.message : String(error || "LOCAL_AGENT_HEARTBEAT_FAILED");
const result = {
ok: false,
status: 0,
body,
};
if (runtime && typeof runtime === "object") {
runtime.lastHeartbeatAt = new Date().toISOString();
runtime.lastHeartbeatOk = false;
runtime.lastHeartbeatStatus = 0;
runtime.lastHeartbeatBody = body;
}
return result;
}