fix(host): resolve Host-001 — exclude leader-only active-node check from /health/ready

This commit is contained in:
Joseph Doherty
2026-05-16 19:40:40 -04:00
parent 7d7214a4ca
commit a0e6a36e79
3 changed files with 68 additions and 4 deletions

View File

@@ -131,9 +131,14 @@ try
app.UseAuthorization();
app.UseAntiforgery();
// WP-12: Map readiness endpoint — returns 503 until all checks pass, 200 when ready
// WP-12: Map readiness endpoint — returns 503 until ready, 200 when ready.
// REQ-HOST-4a defines readiness as cluster membership + DB connectivity,
// explicitly NOT cluster leadership. The leader-only "active-node" check is
// excluded here so a fully operational standby central node reports ready;
// leadership is reported separately on /health/active.
app.MapHealthChecks("/health/ready", new HealthCheckOptions
{
Predicate = check => check.Name != "active-node",
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});