mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Clear valueWatchers instead of removing every entry using a loop
This commit is contained in:
		@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user