chore(P14-8): 完成运营化与验收收口
这个提交包含在:
+20
-16
@@ -77,9 +77,9 @@ async function buildApp() {
|
||||
|
||||
const allowedOrigins = config.appOrigin
|
||||
? config.appOrigin
|
||||
.split(",")
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
.split(",")
|
||||
.map((s) => s.trim())
|
||||
.filter(Boolean)
|
||||
: null;
|
||||
|
||||
await app.register(cors, {
|
||||
@@ -187,6 +187,10 @@ async function buildApp() {
|
||||
app.log.info("OpenAPI docs enabled at /api/docs");
|
||||
}
|
||||
|
||||
if (config.otelTracesEnabled) {
|
||||
app.log.info("OTel tracing enabled");
|
||||
}
|
||||
|
||||
app.get(
|
||||
"/health",
|
||||
{
|
||||
@@ -233,19 +237,19 @@ async function buildApp() {
|
||||
},
|
||||
},
|
||||
async (request, reply) => {
|
||||
try {
|
||||
await app.prisma.$queryRaw`SELECT 1`;
|
||||
return reply.send({ requestId: request.id, data: { ok: true } });
|
||||
} catch (error) {
|
||||
app.log.error({ err: error, requestId: request.id }, "Readiness check failed");
|
||||
throw new AppError({
|
||||
code: "SYS_503",
|
||||
message: "Service Unavailable",
|
||||
statusCode: 503,
|
||||
details: { db: "unreachable" },
|
||||
});
|
||||
}
|
||||
},
|
||||
try {
|
||||
await app.prisma.$queryRaw`SELECT 1`;
|
||||
return reply.send({ requestId: request.id, data: { ok: true } });
|
||||
} catch (error) {
|
||||
app.log.error({ err: error, requestId: request.id }, "Readiness check failed");
|
||||
throw new AppError({
|
||||
code: "SYS_503",
|
||||
message: "Service Unavailable",
|
||||
statusCode: 503,
|
||||
details: { db: "unreachable" },
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (config.metricsEnabled) {
|
||||
|
||||
在新工单中引用
屏蔽一个用户