cachier icon indicating copy to clipboard operation
cachier copied to clipboard

Dynamically change cache directory

Open mmmikael opened this issue 4 years ago • 1 comments

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?

mmmikael avatar Aug 06 '20 14:08 mmmikael

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...

shaypal5 avatar Aug 07 '20 15:08 shaypal5

@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)

lordjabez avatar Apr 01 '23 15:04 lordjabez

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.

shaypal5 avatar Apr 02 '23 09:04 shaypal5