From 040b9148de75ecd418d16e4e912e9560ae8a8f7c Mon Sep 17 00:00:00 2001 From: Kharec Date: Mon, 16 Feb 2026 08:43:01 +0100 Subject: [PATCH] fix(health): treat SMTP unhealthy as degraded at app level --- internal/health/health.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/health/health.go b/internal/health/health.go index 588fc8b..58a8eee 100644 --- a/internal/health/health.go +++ b/internal/health/health.go @@ -35,12 +35,17 @@ type OverallResult struct { func determineOverallStatus(results map[string]Result) Status { hasUnhealthy := false + hasSMTPUnhealthy := false hasDegraded := false - for _, result := range results { + for name, result := range results { switch result.Status { case StatusUnhealthy: - hasUnhealthy = true + if name == "smtp" { + hasSMTPUnhealthy = true + } else { + hasUnhealthy = true + } case StatusDegraded: hasDegraded = true } @@ -49,7 +54,7 @@ func determineOverallStatus(results map[string]Result) Status { if hasUnhealthy { return StatusUnhealthy } - if hasDegraded { + if hasDegraded || hasSMTPUnhealthy { return StatusDegraded } return StatusHealthy