Merged
Conversation
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.
6cb4e5a to
f2def3a
Compare
Contributor
Author
|
Fix #218 |
Contributor
Author
|
fix #867 |
aac377e to
a77000a
Compare
a77000a to
9591110
Compare
This file contains hidden or 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
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 handlingBuildEventwhen 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.Groupthat takesfunc() errorinstead 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.