Open acjay opened 8 years ago
Actually, I'm realizing that the line linked to above isn't exactly the source of my problem. My key's aren't being evicted on time, but it doesn't have to do with the put behavior. I'm making reads after the configured expiration time, but I'm not seeing the memoized function being invoked.
Upon further investigation, the problem is that calling the memoized function performs its lookup though hit
, which does no expiration checking, unlike get
. Is this an oversight? Why does hit
exist? Interestingly, hit
unconditionally attempts a put, but as mentioned above, pruning only happens every thousandth time.
+1 to hit being documented. I looked around and couldn't figure out what it's meant for either. @sritchie any idea?
I've been experiencing unexpected behavior with MutableTTLCache not actually evicting expired keys. It seems it only checks for expiration every 1000 puts. I suppose this probably makes sense under certain circumstances, but it isn't documented or configurable.