2
0

Increment should return an error if the targeted item has expired

This commit is contained in:
Patrick Mylund Nielsen
2012-01-04 11:37:02 +01:00
parent e5b84e20fc
commit ac1a1aeef9
+1 -1
View File
@@ -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")
} }