From dc13ea6555b072bfe2bfc55bbeb6c044f8faefdd Mon Sep 17 00:00:00 2001 From: Ashish Naware Date: Tue, 17 Sep 2024 09:13:17 -0700 Subject: [PATCH] nit: added comment explaining function behavior Signed-off-by: Ashish Naware --- pkg/observer/cache.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/observer/cache.go b/pkg/observer/cache.go index 63384282fb9..64c4e39b27c 100644 --- a/pkg/observer/cache.go +++ b/pkg/observer/cache.go @@ -15,9 +15,9 @@ type cache struct { size int } -func newCache( - dataCacheSize int, -) (*cache, error) { +// newCache constructs a cache of fixed size with the callback function that increments +// data_cache_evictions_total counter every time the cache is evicted. +func newCache(dataCacheSize int) (*cache, error) { lruCache, err := lru.NewWithEvict( dataCacheSize, func(_ dataapi.DataEventId, _ []byte) {