fix(api): keep live health probes within web budget (#1916)

This commit is contained in:
Lyon
2026-06-22 19:53:26 +08:00
committed by GitHub
parent ca1fdb2668
commit 356a35e9b0
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ async function observeLiveBuildService(service, options) {
const metadataRecords = liveBuildRecordsFromMetadata(service);
const metadataRecord = metadataRecords[0] ?? null;
if (service.serviceId === CLOUD_API_SERVICE_ID) {
const health = await options.buildHealthPayload(options);
const health = await options.buildHealthPayload({ ...options, healthMode: "live" });
return liveBuildRecordFromHealth(service, {
ok: true,
status: 200,
+2 -1
View File
@@ -591,8 +591,9 @@ async function handleRestAdapter(request, response, url, options) {
}
if (request.method === "GET" && url.pathname === "/v1") {
const dbProbeOptions = { ...(options.dbProbe ?? {}), timeoutMs: 500 };
const [dbProbe, codeAgent, runtime] = await Promise.all([
observeHttpRoutePhase(request, options, "v1.db_readiness", () => buildDbRuntimeReadiness(options.env ?? process.env, options.dbProbe)),
observeHttpRoutePhase(request, options, "v1.db_readiness", () => buildDbRuntimeReadiness(options.env ?? process.env, dbProbeOptions)),
observeHttpRoutePhase(request, options, "v1.code_agent_availability", () => describeCodeAgentAvailability(options.env ?? process.env, options)),
observeHttpRoutePhase(request, options, "v1.runtime_readiness", () => runtimeReadiness(options.runtimeStore))
]);