Also added in GetWithExpiration
This commit is contained in:
parent
b1291d9dbe
commit
cf0198ac7d
1
cache.go
1
cache.go
|
@ -152,6 +152,7 @@ func (c *cache) GetWithExpiration(k string) (interface{}, time.Time, bool) {
|
||||||
if item.Expiration > 0 {
|
if item.Expiration > 0 {
|
||||||
if time.Now().UnixNano() > item.Expiration {
|
if time.Now().UnixNano() > item.Expiration {
|
||||||
c.mu.RUnlock()
|
c.mu.RUnlock()
|
||||||
|
c.Delete(k)
|
||||||
return nil, time.Time{}, false
|
return nil, time.Time{}, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue