From eb3aa21e37d4cb0bca4f95e9bbf2c45eddac92d1 Mon Sep 17 00:00:00 2001 From: yusing Date: Mon, 22 Dec 2025 12:04:09 +0800 Subject: [PATCH] fix(healthcheck): fix fileserver health check by removing zero port check --- internal/watcher/health/monitor/monitor.go | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/internal/watcher/health/monitor/monitor.go b/internal/watcher/health/monitor/monitor.go index 2266780e..f9268bc4 100644 --- a/internal/watcher/health/monitor/monitor.go +++ b/internal/watcher/health/monitor/monitor.go @@ -33,8 +33,6 @@ type ( checkHealth HealthCheckFunc startTime time.Time - isZeroPort bool - notifyFunc notif.NotifyFunc numConsecFailures atomic.Int64 downNotificationSent atomic.Bool @@ -91,13 +89,6 @@ func newMonitor(u *url.URL, cfg types.HealthCheckConfig, healthCheckFunc HealthC mon.url.Store(u) mon.status.Store(types.StatusHealthy) mon.lastResult.Store(types.HealthCheckResult{Healthy: true, Detail: "started"}) - - port := u.Port() - mon.isZeroPort = port == "" || port == "0" - if mon.isZeroPort { - mon.status.Store(types.StatusUnknown) - mon.lastResult.Store(types.HealthCheckResult{Healthy: false, Detail: "no port detected"}) - } return mon } @@ -119,10 +110,6 @@ func (mon *monitor) Start(parent task.Parent) gperr.Error { return ErrNegativeInterval } - if mon.isZeroPort { - return nil - } - mon.service = parent.Name() mon.task = parent.Subtask("health_monitor", true)