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
Hi, is it possible to implement cron-like clearing/resetting our cache?
It will be good to clear cache, for example, every hour
I don't mean the lifetime of the cached items, i mean a direct check for expired from the current time to the next "necessary", for example, clearing the entire cache every 15th minute of every hour, regardless of when the object was cached
The text was updated successfully, but these errors were encountered:
If you want to clear expired items, the timed and timed-sized stores have a flush method to do so: https://docs.rs/cached/latest/cached/struct.TimedSizedCache.html#method.flush. I don’t want to add functionality beyond that though since it becomes dependent on how you would prefer background tasks be run. You can either spawn a thread or a task that loops, sleeps 15m, acquires the cache lock (if the function is async, then the lock is also async)
Hi, is it possible to implement cron-like clearing/resetting our cache?
It will be good to clear cache, for example, every hour
I don't mean the lifetime of the cached items, i mean a direct check for expired from the current time to the next "necessary", for example, clearing the entire cache every 15th minute of every hour, regardless of when the object was cached
The text was updated successfully, but these errors were encountered: