muesli / cache2go

Concurrency-safe Go caching library with expiration capabilities and access counters
Other
2.11k stars 518 forks source link

Feature for the possibility of deletion based on create time. #59

Open dreamblack86 opened 2 years ago

dreamblack86 commented 2 years ago

Hi @muesli, As suggested in the Issue #57 by you, here is my PR incl. test cases for review.

After taking a closer look at the code and now understanding very well how the internal cleanup process works I came to the following solution. By the way, I have to mention that my approach is very similar to #45. I saw it by chance after I had finished my solution. =) It shows that some had the same idea and probably the need for it.

I am very curious about your feedback

hooklab commented 2 years ago

Hi @muesli, As suggested in the Issue #57 by you, here is my PR incl. test cases for review.

After taking a closer look at the code and now understanding very well how the internal cleanup process works I came to the following solution. By the way, I have to mention that my approach is very similar to #45. I saw it by chance after I had finished my solution. =) It shows that some had the same idea and probably the need for it.

I am very curious about your feedback

How about this ?