Compare commits
2 Commits
4eb0a6360f
...
31ef30c941
| Author | SHA1 | Date | |
|---|---|---|---|
| 31ef30c941 | |||
| d4a89325e0 |
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user