mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-28 02:37:11 +00:00
topology-gc: move initial GC out of startNodeInformer()
Small refactor. Contextually this feels more like under periodicGC().
This commit is contained in:
parent
a60502a313
commit
f05b0e26ea
1 changed files with 3 additions and 2 deletions
|
@ -146,6 +146,9 @@ func (n *topologyGC) garbageCollect() {
|
|||
|
||||
// periodicGC runs garbage collector at every gcPeriod to make sure we haven't missed any node
|
||||
func (n *topologyGC) periodicGC(gcPeriod time.Duration) {
|
||||
// Do initial round of garbage collection at startup time
|
||||
n.garbageCollect()
|
||||
|
||||
gcTrigger := time.NewTicker(gcPeriod)
|
||||
defer gcTrigger.Stop()
|
||||
for {
|
||||
|
@ -172,8 +175,6 @@ func (n *topologyGC) startNodeInformer() error {
|
|||
n.factory.Start(n.stopChan)
|
||||
n.factory.WaitForCacheSync(n.stopChan)
|
||||
|
||||
n.garbageCollect()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue