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

LruRedux::TTL::ThreadSafeCache.delete does not return the deleted item as docs say #22

Open
adam-hampton-sp opened this issue Oct 11, 2023 · 0 comments

Comments

@adam-hampton-sp
Copy link

adam-hampton-sp commented Oct 11, 2023

The LruRedux::TTL::ThreadSafeCache.delete method does not return the deleted item as docs say. It looks like the code returns an expiration time float value and not the deleted item.

Easy enough to work around, but we need to either update the README docs or change the library's behavior.

Example reproduction:

my_cache = LruRedux::TTL::ThreadSafeCache.new(8, 300)
my_cache["a"] = "This is string A"
my_cache["b"] = "This is string B"

result_obj = my_cache.delete "a"
puts "result_obj: #{result_obj} #{result_obj.class}"

This produces output like:

result_obj: 1697043228.1882849 Float

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

No branches or pull requests

1 participant