-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting cache entries when expired #45
Comments
Your function has three parts:
With regard to (2), it's potentially a good idea to have some flavor of a If you are worried about there being a So maybe my question is why should |
Actually I was not thinking of a file belonging to a dir_archive, but to a file which is the output of a memoized function. So in my case I have something like:
Another use case could be (but I don't have concrete examples):
My current approach of wrapping a memoized function seems to work (I haven't checked in the long run the additional burden of checking every call), but I wanted to see if it can be interesting having the cache dealing with it. |
So, you are thinking that the filename would be an output of a memoized function…? Then basically, checking if the file is "valid" has nothing to do with it being cached. So, I'm not sure I understand why this should be built-in to You might want to look at what is available from the |
This is a very old issue, but a related question: Is there currently any functionality to set an elapsed time for an object to expire and be removed from the cache and/or archive? |
@petebachant AFAIK, no. However, you can inherit the class in |
entries that expire (after a pre-determined time, or after some other condition is met) are "coming soon" |
I'd like to delete some cache entries when they are not valid anymore (for example, my result is a filename, and I want to discard it if the file does not exist). Is there a direct way to do it? Is it an enhancement you could be interested in?
Here is my workaround:
https://gist.github.com/livia-b/63ffd88a4da5dcb4b357
The text was updated successfully, but these errors were encountered: