Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #122] It's not possible to reuse a key after TTL eviction #129

Closed
ldechoux opened this issue Jan 30, 2020 · 0 comments · Fixed by #130
Closed

[PR #122] It's not possible to reuse a key after TTL eviction #129

ldechoux opened this issue Jan 30, 2020 · 0 comments · Fixed by #130

Comments

@ldechoux
Copy link
Contributor

ldechoux commented Jan 30, 2020

Hello,

I've found an issue when playing with the new TTL feature.
It's not possible to reuse a key to update the cache with a new value.

The sample use case :

c, err := NewCache(...)

// Add a value with key 1 in the cache
c.SetWithTTL(1, 1, 1, 5*time.Second)
_, ok := c.Get(1) // return true

// some time later
// Add another value with key 1 in the cache
c.SetWithTTL(1, 1, 1, 5*time.Second)
_, ok := c.Get(1) // return false

I submit the following PR to correct this issue : #130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant