Skip to content

Commit

Permalink
Small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
VillePihlava committed Feb 7, 2023
1 parent 4d1fe19 commit 7450a0b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions pkg/nfd-worker/nfd-worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,11 @@ func newDefaultConfig() *NFDConfig {
func (w *nfdWorker) createTicker() *time.Ticker {
if w.config.Core.SleepInterval.Duration > 0 {
return time.NewTicker(w.config.Core.SleepInterval.Duration)
} else {
// If the sleep interval is not a positive number, the ticker will act as if it was set to an infinite duration by not ticking.
t := time.NewTicker(time.Hour)
t.Stop()
return t
}
// If the sleep interval is not a positive number, the ticker will act as if it was set to an infinite duration by not ticking.
t := time.NewTicker(time.Hour)
t.Stop()
return t
}

// Run feature discovery.
Expand All @@ -197,9 +196,7 @@ func (w *nfdWorker) runFeatureDiscovery() error {

// Update the node with the feature labels.
if !w.config.Core.NoPublish {
if err := w.advertiseFeatures(labels); err != nil {
return err
}
return w.advertiseFeatures(labels)
}

return nil
Expand Down

0 comments on commit 7450a0b

Please sign in to comment.