Skip to content

Commit

Permalink
Merge pull request #129 from CoderTH/fix-metrics-bug
Browse files Browse the repository at this point in the history
fix: loss of metrics after vdeivce restart
  • Loading branch information
archlitchi authored Jan 19, 2024
2 parents e5a7647 + 8a84972 commit 2d4e2d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ func (s *Scheduler) RegisterFromNodeAnnotatons() error {
klog.Errorln("nodes list failed", err.Error())
return err
}
nodeNames := []string{}
for _, val := range nodes {
nodeNames = append(nodeNames, val.Name)
for devhandsk, devreg := range device.KnownDevice {
_, ok := val.Annotations[devreg]
if !ok {
Expand Down Expand Up @@ -229,6 +231,11 @@ func (s *Scheduler) RegisterFromNodeAnnotatons() error {
}
}
}
_, _, err = s.getNodesUsage(&nodeNames, nil)
if err != nil {
klog.Errorln("get node usage failed", err.Error())
return err
}
time.Sleep(time.Second * 15)
}
}
Expand Down

0 comments on commit 2d4e2d1

Please sign in to comment.