1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 09:00:55 +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()
defer bc.lock.Unlock()
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")
} else {
bc.items[name] = &t