Skip to content
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

Add cache for common package queries #22491

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KN4CK3R
Copy link
Member

@KN4CK3R KN4CK3R commented Jan 17, 2023

This adds a cache for common package queries in GetPackageDescriptor. Code which needs to process a list of packages benefits from this change. This skips 350 queries in the package integration tests for example.

@KN4CK3R KN4CK3R added type/enhancement An improvement of existing functionality topic/packages labels Jan 17, 2023
@KN4CK3R KN4CK3R added this to the 1.19.0 milestone Jan 17, 2023
@lunny
Copy link
Member

lunny commented Jan 19, 2023

Maybe we can wait #22294

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 19, 2023
@KN4CK3R
Copy link
Member Author

KN4CK3R commented Jan 19, 2023

I don't think this is related because this cache should only be valid within one request. If you cache these objects longer than that you may get problems with expired/updated values.

@lunny
Copy link
Member

lunny commented Jan 19, 2023

I don't think this is related because this cache should only be valid within one request. If you cache these objects longer than that you may get problems with expired/updated values.

Yes, it's the same. ContextCache means cache in one request.

@KN4CK3R
Copy link
Member Author

KN4CK3R commented Jan 19, 2023

Oh, my mistake. I mixed up that PR with the global cache.

@lunny
Copy link
Member

lunny commented Feb 21, 2023

I think this could be rewritten since #22294 merged.

@yardenshoham yardenshoham modified the milestones: 1.19.0, 1.20.0 Feb 22, 2023
@yardenshoham yardenshoham added the outdated/backport/v1.19 This PR should be backported to Gitea 1.19 label Feb 22, 2023
@yardenshoham yardenshoham removed the outdated/backport/v1.19 This PR should be backported to Gitea 1.19 label May 1, 2023
@delvh delvh removed this from the 1.20.0 milestone Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. topic/packages type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants