8e8d39d3 by slene

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

1 parent 42958ddd
...@@ -53,11 +53,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, expired int64) error ...@@ -53,11 +53,7 @@ func (bc *MemoryCache) Put(name string, value interface{}, expired int64) error
53 Lastaccess: time.Now(), 53 Lastaccess: time.Now(),
54 expired: expired, 54 expired: expired,
55 } 55 }
56 if _, ok := bc.items[name]; ok { 56 bc.items[name] = &t
57 return errors.New("the key is exist")
58 } else {
59 bc.items[name] = &t
60 }
61 return nil 57 return nil
62 } 58 }
63 59
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!