From 0809c46266c7d922c3e8ad4f40e12a7ca39cf424 Mon Sep 17 00:00:00 2001 From: "celo.choi" Date: Fri, 22 Mar 2024 15:18:56 +0900 Subject: [PATCH] Disable LRU --- common/lru/lru.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/lru/lru.go b/common/lru/lru.go index 45965adb0d..c7f336dae9 100644 --- a/common/lru/lru.go +++ b/common/lru/lru.go @@ -16,7 +16,9 @@ package lru -import "sync" +import ( + "sync" +) // Cache is a LRU cache. // This type is safe for concurrent use. @@ -40,6 +42,7 @@ func (c *Cache[K, V]) Add(key K, value V) (evicted bool) { // Contains reports whether the given key exists in the cache. func (c *Cache[K, V]) Contains(key K) bool { + return false c.mu.Lock() defer c.mu.Unlock() @@ -48,6 +51,7 @@ func (c *Cache[K, V]) Contains(key K) bool { // Get retrieves a value from the cache. This marks the key as recently used. func (c *Cache[K, V]) Get(key K) (value V, ok bool) { + return value, false c.mu.Lock() defer c.mu.Unlock()