Also added in GetWithExpiration

This commit is contained in:
Durand Fabrice 2018-01-04 09:39:16 -05:00
parent b1291d9dbe
commit cf0198ac7d
1 changed files with 1 additions and 0 deletions

View File

@ -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
} }