fix(api): keep live health probes within web budget (#1916)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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))
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user