Compare commits

..

2 Commits

2 changed files with 6 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ func (c *SMTPChecker) Check(ctx context.Context) Result {
conn, err := net.Dial("tcp", address)
if err != nil {
result.Status = StatusDegraded
result.Status = StatusUnhealthy
result.Message = fmt.Sprintf("Failed to connect to SMTP server: %v", err)
result.Latency = time.Since(start)
return result
@@ -54,7 +54,7 @@ func (c *SMTPChecker) Check(ctx context.Context) Result {
client, err := smtp.NewClient(conn, c.config.Host)
if err != nil {
result.Status = StatusDegraded
result.Status = StatusUnhealthy
result.Message = fmt.Sprintf("Failed to create SMTP client: %v", err)
result.Latency = time.Since(start)
return result

View File

@@ -36,8 +36,8 @@ func TestSMTPChecker_Check_InvalidPort(t *testing.T) {
result := checker.Check(ctx)
if result.Status != StatusDegraded {
t.Errorf("expected degraded status for invalid port, got %s", result.Status)
if result.Status != StatusUnhealthy {
t.Errorf("expected unhealthy status for invalid port, got %s", result.Status)
}
}
@@ -59,8 +59,8 @@ func TestSMTPChecker_Check_ConnectionRefused(t *testing.T) {
result := checker.Check(ctx)
if result.Status != StatusDegraded {
t.Errorf("expected degraded status for connection refused, got %s", result.Status)
if result.Status != StatusUnhealthy {
t.Errorf("expected unhealthy status for connection refused, got %s", result.Status)
}
}