Skip to content

Call OnEvicted when Set replaces an expired item - #193

Open
AshSgDe29071999 wants to merge 1 commit into
patrickmn:masterfrom
AshSgDe29071999:fix/on-evicted-expired-overwrite
Open

Call OnEvicted when Set replaces an expired item#193
AshSgDe29071999 wants to merge 1 commit into
patrickmn:masterfrom
AshSgDe29071999:fix/on-evicted-expired-overwrite

Conversation

@AshSgDe29071999

Copy link
Copy Markdown

Get misses expired keys, but Set still overwrote the slot without running OnEvicted, so resources the callback was meant to release leaked.

Call OnEvicted when replacing an expired item. A live overwrite still does not evict.

Fixes #176

Test

go test . -run TestOnEvictedExpiredOverwrite -count=1

Get misses expired keys, but Set still overwrote the slot without
running OnEvicted, so resources the callback was meant to release
leaked. Live overwrites still do not evict.

See patrickmn#176
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.

OnEvicted is not called for every expired value

1 participant