refactor health module

This commit is contained in:
yusing
2024-11-13 06:46:01 +08:00
parent 6a2638c70c
commit f3b21e6bd9
9 changed files with 37 additions and 29 deletions

View File

@@ -19,6 +19,7 @@ import (
"github.com/yusing/go-proxy/internal/task"
F "github.com/yusing/go-proxy/internal/utils/functional"
"github.com/yusing/go-proxy/internal/watcher/health"
"github.com/yusing/go-proxy/internal/watcher/health/monitor"
)
type (
@@ -111,7 +112,7 @@ func (r *HTTPRoute) Start(providerSubtask task.Task) E.Error {
r.handler = waker
r.HealthMon = waker
case entry.UseHealthCheck(r):
r.HealthMon = health.NewHTTPHealthMonitor(r.rp.TargetURL, r.HealthCheck)
r.HealthMon = monitor.NewHTTPHealthMonitor(r.rp.TargetURL, r.HealthCheck)
}
if r.handler == nil {