diff --git a/ttl.go b/ttl.go index 337976ad..4e5c0248 100644 --- a/ttl.go +++ b/ttl.go @@ -127,8 +127,9 @@ func (m *expirationMap) cleanup(store store, policy policy, onEvict itemCallback m.Unlock() for key, conflict := range keys { + expr := store.Expiration(key) // Sanity check. Verify that the store agrees that this key is expired. - if store.Expiration(key).After(now) { + if expr.After(now) { continue } @@ -138,9 +139,10 @@ func (m *expirationMap) cleanup(store store, policy policy, onEvict itemCallback if onEvict != nil { onEvict(&Item{Key: key, - Conflict: conflict, - Value: value, - Cost: cost, + Conflict: conflict, + Value: value, + Cost: cost, + Expiration: expr, }) } }