1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 09:10:51 +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(),
expired: expired,
}
if _, ok := bc.items[name]; ok {
return errors.New("the key is exist")
} else {
bc.items[name] = &t
}
bc.items[name] = &t
return nil
}