mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-04 03:03:37 +08:00
fix: lru lock
This commit is contained in:
parent
de20311c4b
commit
34ced79c1b
@ -102,7 +102,9 @@ func (x *LayLRU[K, V]) GetBatch(keys []K, fetch func(keys []K) (map[K]V, error))
|
|||||||
v, ok := x.core.Get(key)
|
v, ok := x.core.Get(key)
|
||||||
x.lock.Unlock()
|
x.lock.Unlock()
|
||||||
if ok {
|
if ok {
|
||||||
|
v.lock.Lock()
|
||||||
expires, value, err1 := v.expires, v.value, v.err
|
expires, value, err1 := v.expires, v.value, v.err
|
||||||
|
v.lock.Unlock()
|
||||||
if expires != 0 && expires > time.Now().UnixMilli() {
|
if expires != 0 && expires > time.Now().UnixMilli() {
|
||||||
x.target.IncrGetHit()
|
x.target.IncrGetHit()
|
||||||
res[key] = value
|
res[key] = value
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user