mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add cache for branch divergence on branch list page (#29577)
The branch page for blender project will take 6s because calculating divergence is very slow. This PR will add a cache for the branch divergence calculation. So when the second visit the branch list, it will take only less 200ms.
This commit is contained in:
@@ -220,6 +220,11 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
|
||||
}
|
||||
}
|
||||
|
||||
// delete cache for divergence
|
||||
if err := DelDivergenceFromCache(repo.ID, branch); err != nil {
|
||||
log.Error("DelDivergenceFromCache: %v", err)
|
||||
}
|
||||
|
||||
commits := repo_module.GitToPushCommits(l)
|
||||
commits.HeadCommit = repo_module.CommitToPushCommit(newCommit)
|
||||
|
||||
|
Reference in New Issue
Block a user