fix lru cache expire

This commit is contained in:
unknown 2024-03-22 22:16:02 +03:30
parent 1d7d6515ce
commit 3c063b330d

View file

@ -232,7 +232,7 @@ func (c *LruCache[K, V]) get(key K) *entry[K, V] {
return nil
}
if !c.staleReturn && c.maxAge > 0 && le.Value.expires <= time.Now().Unix() {
if !c.staleReturn && le.Value.expires > 0 && le.Value.expires <= time.Now().Unix() {
c.deleteElement(le)
c.maybeDeleteOldest()