refactor(health.akka): review polish (internal decision helper, role guard, factory results, test coverage) + fix SPEC §4 gate description

This commit is contained in:
Joseph Doherty
2026-06-01 07:04:29 -04:00
parent edbc79204f
commit 1c2b23cbbb
6 changed files with 39 additions and 13 deletions
@@ -45,7 +45,12 @@ public sealed class AkkaClusterHealthCheck : IHealthCheck
var status = Cluster.Get(system).SelfMember.Status;
var health = _policy.Evaluate(status);
var description = $"Akka cluster member status: {status}";
return Task.FromResult(new HealthCheckResult(health, description));
var result = health switch
{
HealthStatus.Healthy => HealthCheckResult.Healthy(description),
HealthStatus.Degraded => HealthCheckResult.Degraded(description),
_ => HealthCheckResult.Unhealthy(description),
};
return Task.FromResult(result);
}
}