You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was curious about this too; if you do remove can't this cause callers to have a cache miss until your insert logic finishes? Maybe this is ok if there's a RwLock surrounding.
Alternatively, can there be a way to bump the ttl value by a potentially new set amount? This way you can do get_mut and update your cache entry if needed, and just extend the ttl rather than full remove/insert. (Maybe this is what you had in mind above.)
Edit: Sorry I wasn't really using my brain. It's just a map so I can just insert again with my updated ttl.
How do I prevent actively used TtlCache entry from being expired and run its
Drop::drop
?Update: looks like
remove
+insert
works. Maybe explicitcache.refresh(&key)
would be more readable?The text was updated successfully, but these errors were encountered: