chore: enable fullUserCache

This commit is contained in:
icey-yu
2024-09-05 17:22:05 +08:00
parent 7f8d26c36b
commit d9064867d5
12 changed files with 137 additions and 24 deletions
+6
View File
@@ -116,6 +116,12 @@ func (x *LayLRU[K, V]) SetHasBatch(data map[K]V) bool {
// return x.core.Contains(key)
//}
func (x *LayLRU[K, V]) Set(key K, value V) {
x.lock.Lock()
defer x.lock.Unlock()
x.core.Add(key, &layLruItem[V]{value: value, expires: time.Now().Add(x.successTTL).UnixMilli()})
}
func (x *LayLRU[K, V]) SetHas(key K, value V) bool {
x.lock.Lock()
defer x.lock.Unlock()