Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Check tree cache staleness and invalidate entries automatically #32

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

danports
Copy link
Contributor

Closes #29.

This is based on #27 since it depends on the lazy loading behavior, so there are a bunch of extra commits in here, but I can rebase this if/when #27 is merged.

The main idea is to move the global Tree cache into Repository, and check the staleness of cache entries whenever a Tree is requested. We could theoretically cache trees based on their SHAs rather than their commit-ishes, but then you could wind up with a cache that grows forever - if you keep requesting the master tree but cache individual commits, you'll end up caching every commit as master changes, even though the caller isn't interested in those old commits.

@danports danports force-pushed the refresh-tree-cache branch from f5a693f to 01c9f37 Compare April 20, 2020 01:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Repository class caches trees forever
1 participant