From e7e8d880106a04c5f11beacaca49802153ed7252 Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Thu, 12 Sep 2024 20:10:48 +0800 Subject: [PATCH] fix: lock --- pkg/localcache/lru/lru_lazy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/localcache/lru/lru_lazy.go b/pkg/localcache/lru/lru_lazy.go index 84aa980e8..b4f0377a7 100644 --- a/pkg/localcache/lru/lru_lazy.go +++ b/pkg/localcache/lru/lru_lazy.go @@ -94,11 +94,11 @@ func (x *LayLRU[K, V]) GetBatch(keys []K, fetch func(keys []K) (map[K]V, error)) once sync.Once ) - x.lock.Lock() res := make(map[K]V) queries := make([]K, 0) setVs := make(map[K]*layLruItem[V]) for _, key := range keys { + x.lock.Lock() v, ok := x.core.Get(key) x.lock.Unlock() if ok {