Increment should return an error if the targeted item has expired

master
Patrick Mylund Nielsen 13 years ago
parent e5b84e20fc
commit ac1a1aeef9

@ -191,7 +191,7 @@ func (c *cache) IncrementFloat(k string, n float64) error {
defer c.mu.Unlock() defer c.mu.Unlock()
v, found := c.Items[k] v, found := c.Items[k]
if !found { if !found || v.Expired() {
return fmt.Errorf("Item not found") return fmt.Errorf("Item not found")
} }

Loading…
Cancel
Save