fix(route): incorrect health status for idlewatcher dependencies

This commit is contained in:
yusing
2025-06-05 18:40:40 +08:00
parent 9470a14fe8
commit d240da4393
3 changed files with 10 additions and 2 deletions

View File

@@ -366,6 +366,13 @@ func (r *Route) HealthMonitor() health.HealthMonitor {
return r.HealthMon
}
func (r *Route) SetHealthMonitor(m health.HealthMonitor) {
if r.HealthMon != nil && r.HealthMon != m {
r.HealthMon.Finish("health monitor replaced")
}
r.HealthMon = m
}
func (r *Route) IdlewatcherConfig() *idlewatcher.Config {
return r.Idlewatcher
}

View File

@@ -26,6 +26,7 @@ type (
GetProvider() Provider
TargetURL() *net.URL
HealthMonitor() health.HealthMonitor
SetHealthMonitor(m health.HealthMonitor)
References() []string
Started() <-chan struct{}