diff --git a/pkg/lru/ttl.go b/pkg/lru/ttl.go index 189aa3f..23319e2 100644 --- a/pkg/lru/ttl.go +++ b/pkg/lru/ttl.go @@ -20,6 +20,11 @@ func (l *lruTTl) setKeys(key *proto.BaseKey) int64 { l.mu.Lock() defer l.mu.Unlock() + // 永久存储 + if key.Expire == nil && key.Ttl == 0 { + return 0 + } + ttlTime := time.Now().Unix() if key.Expire != nil { ttlTime = key.Expire.GetSeconds()