Skip to content

BUG: Correctly handle MemoryStorage#add#31

Merged
tstone merged 2 commits intomainfrom
bugfix/MTF-587-mem-add
Jul 7, 2021
Merged

BUG: Correctly handle MemoryStorage#add#31
tstone merged 2 commits intomainfrom
bugfix/MTF-587-mem-add

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
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