Skip to content

Conversation

@jaimem88
Copy link

Check if an item exists and it has expired before setting so that
onEvicted is actually called.

Fixes #48.

@jaimem88
Copy link
Author

@patrickmn for your review 🙏

@jaimem88 jaimem88 force-pushed the fix/48-delete-before-setting branch from 0293691 to 59cc448 Compare October 13, 2020 01:00
Check if an item exists and it has expired before setting so that
onEvicted is actually called.

Fixes patrickmn#48.

Add test and split func

Use nanoseconds instead

Call onEvicted if item existed before setting

Call onEvicted if item.Expired
@jaimem88 jaimem88 force-pushed the fix/48-delete-before-setting branch from aee9b1a to 38560f5 Compare October 14, 2020 23:57
@ayufan
Copy link

ayufan commented Oct 15, 2020 via email

@ayufan
Copy link

ayufan commented Oct 20, 2020

@patrickmn Would you mind looking at this?

@arp242
Copy link

arp242 commented Oct 22, 2020

Note this is a incompatible change, and some people may be relying on the current behaviour.

Also this library doesn't seem maintained at the moment, so little chance it will get merged. It's better to just maintain your own fork if you need this behaviour.

@ViswanathB
Copy link

Trying to find a cache with TTL that has been rigorously tested and this seems to be a popular choice.
However, looks like repo is not maintained and hasn't been released since 2017.
@koalalorenzo Where you able to find any other forks reliable?

Repository owner deleted a comment from pablodz Jan 8, 2024
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.

The OnEvicted function is not called if a value is re-set after expiration but before deletion

4 participants