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

BUG: Correctly handle MemoryStorage#add #31

Merged
merged 2 commits into from
Jul 7, 2021
Merged

Conversation

tstone
Copy link
Collaborator

@tstone tstone commented Jul 7, 2021

Background

When using SharedMemory or InstanceMemory, when add is called, it should add the key if one does not exist. When one exists, it should still add it if the key has expired. The gem was not doing this second behavior. This PR fixes that.

Tasks

  • Code of Conduct reviewed
  • Specs written and passing
  • Backwards-incompatible changes called out in this PR
  • Increment the version file (./lib/atomic_cache/version.rb) when applicable

@tstone tstone requested a review from a team July 7, 2021 22:01
@@ -54,6 +53,12 @@ def delete(raw_key)

protected

def ttl_expired?(entry)
return false unless entry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎 @ unless

Copy link
Contributor

@lebeerman lebeerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 - nice catch on this!

@tstone tstone merged commit 4842771 into main Jul 7, 2021
@tstone tstone deleted the bugfix/MTF-587-mem-add branch July 7, 2021 22:35
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

Successfully merging this pull request may close these issues.

2 participants