fix: ping the active workspace runtime for /health/dwh instead of the legacy config
This commit is contained in:
+14
-1
@@ -117,7 +117,20 @@ export function buildApp(config: AppConfig, deps?: BuildAppDeps): FastifyInstanc
|
||||
return authenticate(req, reply);
|
||||
});
|
||||
app.get("/health", async () => ({ status: "ok" }));
|
||||
app.get("/health/dwh", async () => tht.dbPing());
|
||||
app.get("/health/dwh", async () => {
|
||||
// In the registry system there is no single legacy DWH config: ping the first active
|
||||
// workspace's rendered runtime config. If the registry is not bootstrapped yet, do not
|
||||
// block the app — per-workspace diagnostics and the session precheck own reachability.
|
||||
try {
|
||||
const revisions = await workspaceRegistry.list();
|
||||
if (revisions.length > 0) {
|
||||
return await tht.dbPing(revisions[0].snapshotPath);
|
||||
}
|
||||
} catch {
|
||||
// fall through
|
||||
}
|
||||
return { ok: true, detail: "workspace diagnostics own DWH reachability" };
|
||||
});
|
||||
app.get("/me", async (req) => getPrincipal(req));
|
||||
sessionRoutes(app, {
|
||||
mgr, tht: tht as ThtRunner, hub, getSettings, readiness, listModels, workspaceRegistry,
|
||||
|
||||
Reference in New Issue
Block a user