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

@@ -69,8 +69,6 @@ type (
const ContextKey = "idlewatcher.watcher"
// TODO: replace -1 with neverTick
var (
watcherMap = make(map[string]*Watcher)
watcherMapMu sync.RWMutex
@@ -315,6 +313,8 @@ func NewWatcher(parent task.Parent, r routes.Route, cfg *idlewatcher.Config) (*W
w.dedupDependencies()
r.SetHealthMonitor(w)
w.l = w.l.With().Strs("deps", cfg.DependsOn).Logger()
if exists {
w.l.Debug().Msg("idlewatcher reloaded")