1
0
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:
astaxie 2013-03-26 22:31:54 +08:00
parent 4ef5883f9e
commit 1b715bcbea

View File

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