mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 09:10:55 +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()
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user