Commit 1b715bcb authored by astaxie's avatar astaxie

fix cache bug

parent 4ef5883f
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment