idlewatcher/waker: refactor

This commit is contained in:
yusing
2025-03-08 07:59:10 +08:00
parent 1078731f2d
commit d4d2efe925
3 changed files with 15 additions and 8 deletions

View File

@@ -134,6 +134,10 @@ func (w *Watcher) checkUpdateState() (ready bool, err error) {
return true, nil
}
if !w.running() {
return false, nil
}
if w.metric != nil {
defer w.metric.Set(float64(w.Status()))
}