-
Notifications
You must be signed in to change notification settings - Fork 15
Repository class caches trees forever #29
Comments
Which cache are you referring to? |
computercraft-github/apis/github Line 179 in 208033b
|
I assume the issue is when |
Right - in some ComputerCraft setups, that cache can live for a long time, and |
One issue I see is that the cache itself is supposed to be using weak references for the keys ( computercraft-github/apis/github Line 169 in 208033b
But changing that wouldn't resolve this issue anyway, since a caller might reasonably keep a |
I also don't understand why that cache is defined the way it is. If you're going to have a table with weak references for keys, why not just make the tree SHA table a private field on the |
Forever is a long time. There should be an automatic or manual way to flush the
Repository.tree
cache. Options:Tree
.Repository
to remove the cache entry for a particular commit-ish (or all cache entries).I like the first option better. If one API call is too much of a perf hit for
Repository.tree
, we could make the staleness check optional with a parameter. Thoughts?(Needed for danports/amber#14)
The text was updated successfully, but these errors were encountered: