mirror of
https://github.com/astaxie/beego.git
synced 2024-11-04 21:40:56 +00:00
fix cache bug
This commit is contained in:
parent
4ef5883f9e
commit
1b715bcbea
2
cache.go
2
cache.go
@ -51,7 +51,7 @@ func (bc *BeeCache) Put(name string, value interface{}, expired int) error {
|
|||||||
bc.lock.Lock()
|
bc.lock.Lock()
|
||||||
defer bc.lock.Unlock()
|
defer bc.lock.Unlock()
|
||||||
t := BeeItem{val: value, Lastaccess: time.Now(), expired: expired}
|
t := BeeItem{val: value, Lastaccess: time.Now(), expired: expired}
|
||||||
if _, ok := bc.items[name]; !ok {
|
if _, ok := bc.items[name]; ok {
|
||||||
return errors.New("the key is exist")
|
return errors.New("the key is exist")
|
||||||
} else {
|
} else {
|
||||||
bc.items[name] = &t
|
bc.items[name] = &t
|
||||||
|
Loading…
Reference in New Issue
Block a user