1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 18:50:55 +00:00

fix memory cache Put method should set value when key exist.

This commit is contained in:
slene 2013-09-13 18:04:22 +08:00
parent 42958ddd41
commit 8e8d39d3cb

6
cache/memory.go vendored
View File

@ -53,11 +53,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, expired int64) error
Lastaccess: time.Now(), Lastaccess: time.Now(),
expired: expired, expired: expired,
} }
if _, ok := bc.items[name]; ok { bc.items[name] = &t
return errors.New("the key is exist")
} else {
bc.items[name] = &t
}
return nil return nil
} }