Merge cf0198ac7d
into 46f4078530
This commit is contained in:
commit
7356a5e1cd
2
cache.go
2
cache.go
|
@ -128,6 +128,7 @@ func (c *cache) Get(k string) (interface{}, bool) {
|
|||
if item.Expiration > 0 {
|
||||
if time.Now().UnixNano() > item.Expiration {
|
||||
c.mu.RUnlock()
|
||||
c.Delete(k)
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
|
@ -151,6 +152,7 @@ func (c *cache) GetWithExpiration(k string) (interface{}, time.Time, bool) {
|
|||
if item.Expiration > 0 {
|
||||
if time.Now().UnixNano() > item.Expiration {
|
||||
c.mu.RUnlock()
|
||||
c.Delete(k)
|
||||
return nil, time.Time{}, false
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue