fix: serialize local-agent heartbeats
This commit is contained in:
@@ -7,6 +7,7 @@ import os from "node:os";
|
||||
import { join, resolve } from "node:path";
|
||||
import { discoverCodexProjectCandidatesInWorker } from "./codex-session-discovery.mjs";
|
||||
import { buildCodexTaskExecution } from "./codex-task-runner.mjs";
|
||||
import { createSerializedRunner } from "./serialized-runner.mjs";
|
||||
|
||||
async function loadConfig(configPath) {
|
||||
const raw = await readFile(resolve(configPath), "utf8");
|
||||
@@ -493,7 +494,7 @@ const runtime = {
|
||||
lastProjectDiscoverySummary: null,
|
||||
};
|
||||
|
||||
async function heartbeat() {
|
||||
async function performHeartbeat() {
|
||||
try {
|
||||
const heartbeatProjects = await resolveHeartbeatProjects(config, runtime);
|
||||
const result = await postHeartbeat(config, runtime, heartbeatProjects);
|
||||
@@ -567,6 +568,8 @@ async function heartbeat() {
|
||||
}
|
||||
}
|
||||
|
||||
const heartbeat = createSerializedRunner(performHeartbeat);
|
||||
|
||||
const server = createServer(async (request, response) => {
|
||||
if (request.url === "/health") {
|
||||
response.writeHead(200, { "Content-Type": "application/json" });
|
||||
|
||||
Reference in New Issue
Block a user