diff --git a/pkg/storage/cacher.go b/pkg/storage/cacher.go index 365e224e875..d215f175efd 100644 --- a/pkg/storage/cacher.go +++ b/pkg/storage/cacher.go @@ -502,9 +502,11 @@ func (c *cacheWatcher) stop() { } func (c *cacheWatcher) add(event watchCacheEvent) { + t := time.NewTimer(5 * time.Second) + defer t.Stop() select { case c.input <- event: - case <-time.After(5 * time.Second): + case <-t.C: // This means that we couldn't send event to that watcher. // Since we don't want to blockin on it infinitely, // we simply terminate it.