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

Cache GPG keys, emails and users when list commits #34086

Merged
merged 13 commits into from
Apr 9, 2025

Conversation

lunny
Copy link
Member

@lunny lunny commented Apr 1, 2025

When list commits, some of the commits authors are the same at many situations. But current logic will always fetch the same GPG keys from database. This PR will cache the GPG keys, emails and users for the context so that reducing the database queries.

@lunny lunny added the performance/speed performance issues with slow downs label Apr 1, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 1, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Apr 1, 2025
@lunny lunny marked this pull request as draft April 1, 2025 06:18
@lunny lunny changed the title Cache gpg keys fetch from database when list commits Cache gpg keys, emails and users fetch from database when list commits Apr 1, 2025
@lunny lunny marked this pull request as ready for review April 1, 2025 19:48
@lunny lunny changed the title Cache gpg keys, emails and users fetch from database when list commits Cache gpg keys, emails and users when list commits Apr 1, 2025
@lunny lunny added this to the 1.24.0 milestone Apr 1, 2025
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 2, 2025
@lunny lunny changed the title Cache gpg keys, emails and users when list commits Cache GPG keys, emails and users when list commits Apr 2, 2025
@lunny lunny requested a review from wxiaoguang April 4, 2025 17:49
wxiaoguang

This comment was marked as outdated.

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 8, 2025
@wxiaoguang wxiaoguang dismissed their stale review April 8, 2025 08:21

Hmm, maybe misread, will take a deep look

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged labels Apr 8, 2025
@pull-request-size pull-request-size bot added size/M and removed size/L labels Apr 8, 2025
@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 8, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 9, 2025
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 9, 2025
@lunny lunny enabled auto-merge (squash) April 9, 2025 16:08
@lunny lunny merged commit 4a5af4e into go-gitea:main Apr 9, 2025
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Apr 9, 2025
@lunny lunny deleted the lunny/cache_get_gpgkeys branch April 9, 2025 18:16
YaFou pushed a commit to YaFou/gitea that referenced this pull request Apr 9, 2025
When list commits, some of the commits authors are the same at many
situations. But current logic will always fetch the same GPG keys from
database. This PR will cache the GPG keys, emails and users for the
context so that reducing the database queries.

---------

Co-authored-by: wxiaoguang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code performance/speed performance issues with slow downs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants