mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #79599 from tedyu/cacher-clear-watchers
Clear valueWatchers instead of removing every entry using a loop
This commit is contained in:
commit
1b259bf75a
@ -154,10 +154,10 @@ func (i *indexedWatchers) terminateAll(objectType reflect.Type, done func(*cache
|
|||||||
klog.Warningf("Terminating all watchers from cacher %v", objectType)
|
klog.Warningf("Terminating all watchers from cacher %v", objectType)
|
||||||
}
|
}
|
||||||
i.allWatchers.terminateAll(done)
|
i.allWatchers.terminateAll(done)
|
||||||
for index, watchers := range i.valueWatchers {
|
for _, watchers := range i.valueWatchers {
|
||||||
watchers.terminateAll(done)
|
watchers.terminateAll(done)
|
||||||
delete(i.valueWatchers, index)
|
|
||||||
}
|
}
|
||||||
|
i.valueWatchers = map[string]watchersMap{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// As we don't need a high precision here, we keep all watchers timeout within a
|
// As we don't need a high precision here, we keep all watchers timeout within a
|
||||||
|
Loading…
Reference in New Issue
Block a user