Files
openmaic/OpenMAIC/app/api/runtime/v1/health/ready/route.ts

24 lines
583 B
TypeScript

import {
inspectLearningReadiness,
LEARNING_ENGINE_API_VERSION,
LEARNING_ENGINE_SERVICE,
} from '@/lib/makelore-runtime/health';
export const dynamic = 'force-dynamic';
export async function GET() {
const readiness = await inspectLearningReadiness();
return Response.json(
{
service: LEARNING_ENGINE_SERVICE,
apiVersion: LEARNING_ENGINE_API_VERSION,
status: readiness.ready ? 'ready' : 'not_ready',
checks: readiness.checks,
},
{
status: readiness.ready ? 200 : 503,
headers: { 'Cache-Control': 'no-store' },
},
);
}