-
Notifications
You must be signed in to change notification settings - Fork 121
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
fix cache entry expiration - monotinic vs realtime #591
Conversation
The tests make sense to me, but would be great if someone could double-check :) |
|
||
behavior of "get put with TTL" | ||
|
||
it should "store the given key-value pair in the underlying cache with the given TTL, then get it back when not expired" in ticked { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have another one like this, but with an IO.sleep
between put and get. It'll be instant because of how ticked
works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple of tests with sleep.
Thanks! I always mix up the two kinds of clocks, this whole thing reminded me what the difference is 😅 |
Think we could remove expired keys if we read one, as a space optimization - but that can be a different PR :) |
Fixes #522