-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Generic cache layer #938
Merged
Merged
Generic cache layer #938
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MichaelMure
force-pushed
the
cache-reorg
branch
2 times, most recently
from
December 19, 2022 15:24
b8c757d
to
6cb4e5a
Compare
Additionally, remove and concentrate quite a lot of complexity from the cache layer into a "per app" single site where to configure how indexing is done.
MichaelMure
force-pushed
the
cache-reorg
branch
from
December 19, 2022 17:10
6cb4e5a
to
f2def3a
Compare
Fix #218 |
fix #867 |
MichaelMure
force-pushed
the
cache-reorg
branch
3 times, most recently
from
December 23, 2022 00:38
aac377e
to
a77000a
Compare
MichaelMure
force-pushed
the
cache-reorg
branch
from
December 23, 2022 00:41
a77000a
to
9591110
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR brings a massive refactor/rewrite of the cache layer, making its handling of entities generic. This means that it becomes way easier to add more entities, easier to improve caching techniques, easier to manage memory, and avoid sticky code in duplicated code.
Major changes include:
CachedEntityBase
, base type for caching wrapper around an entitySubCache
, generic cache handling for entitieswithSnapshot
, generic efficient snapshot handlingBuildEvent
when building the cache instead of printing, leaving full control for UIs to express those things in a meaningful waybackend.Bugs().New(...)
... , reducing the functions names and making things cleanerGenerally, this untangle quite a lot of code and is a big step forward for git-bug.
Also, introduce
ErrWaitGroup
, a variant ofsync.WaitGroup
/errgroup.Group
that takesfunc() error
instead offunc()
, run all of them to completion (unless the go context expire), and assemble all the errors with the go1.20 multierror support. This IMHO should be included in the standard library.