mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-05 09:01:06 +00:00
Shared Informer Run blocks until all goroutines finish
Fixes #45454 Kubernetes-commit: d789615902ead2a112ad24fbfebe95285b87004b
This commit is contained in:
committed by
Kubernetes Publisher
parent
b5da66a5eb
commit
5f6ea627a3
16
tools/cache/mutation_detector.go
vendored
16
tools/cache/mutation_detector.go
vendored
@@ -79,17 +79,15 @@ type cacheObj struct {
|
||||
|
||||
func (d *defaultCacheMutationDetector) Run(stopCh <-chan struct{}) {
|
||||
// we DON'T want protection from panics. If we're running this code, we want to die
|
||||
go func() {
|
||||
for {
|
||||
d.CompareObjects()
|
||||
for {
|
||||
d.CompareObjects()
|
||||
|
||||
select {
|
||||
case <-stopCh:
|
||||
return
|
||||
case <-time.After(d.period):
|
||||
}
|
||||
select {
|
||||
case <-stopCh:
|
||||
return
|
||||
case <-time.After(d.period):
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
// AddObject makes a deep copy of the object for later comparison. It only works on runtime.Object
|
||||
|
Reference in New Issue
Block a user