mirror of https://github.com/k3s-io/k3s
commit
4be9587b43
|
@ -502,9 +502,11 @@ func (c *cacheWatcher) stop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *cacheWatcher) add(event watchCacheEvent) {
|
func (c *cacheWatcher) add(event watchCacheEvent) {
|
||||||
|
t := time.NewTimer(5 * time.Second)
|
||||||
|
defer t.Stop()
|
||||||
select {
|
select {
|
||||||
case c.input <- event:
|
case c.input <- event:
|
||||||
case <-time.After(5 * time.Second):
|
case <-t.C:
|
||||||
// This means that we couldn't send event to that watcher.
|
// This means that we couldn't send event to that watcher.
|
||||||
// Since we don't want to blockin on it infinitely,
|
// Since we don't want to blockin on it infinitely,
|
||||||
// we simply terminate it.
|
// we simply terminate it.
|
||||||
|
|
Loading…
Reference in New Issue