cachier
cachier copied to clipboard
Dynamically change cache directory
It could be useful to be able to dynamically change the cache directory.
I have made some local changes to support this: https://github.com/signalityai/cachier/commit/9d896a03a817b20743d0d58369814d9219194edb
Is this something you think is interesting to add to the main repo?
Hmm. It's definitely possible! :)
I'd love to hear more about what's your need and use case is; the reason you've added this...
@mmmikael were you still interested in this feature? I'm building a global default mechanism that potentially could support this use case. However, unlike some other parameters like stale_after or next_time, supporting a dynamic cache directory change is trickier, as thread safety needs to be taken into account.
@shaypal5 personally I don't see the value for dynamic changing given the added complexity. But maybe I'm missing something?
(FYI the new default mechanism will still allow changing cache directory globally with a single call, but only before cache decorators are applied)
Yeah, I agree. I think if a contributor comes along and this is THE feature he wants to work on - cool. Otherwise, this is out of scope.