Cache last commit to accelerate the repository directory page visit (#10069)

* Cache last commit to accelerate the repository directory page visit

* Default use default cache configuration

* add tests for last commit cache

* Simplify last commit cache

* Revert Enabled back

* Change the last commit cache default ttl to 8760h

* Fix test
This commit is contained in:
Lunny Xiao 2020-02-02 03:11:32 +08:00 committed by GitHub
parent 046bb05979
commit ce7062a422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 273 additions and 23 deletions

View file

@ -4,8 +4,10 @@
package git
import "gopkg.in/src-d/go-git.v4/plumbing/object"
// LastCommitCache cache
type LastCommitCache interface {
Get(repoPath, ref, entryPath string) (*Commit, error)
Put(repoPath, ref, entryPath string, commit *Commit) error
Get(ref, entryPath string) (*object.Commit, error)
Put(ref, entryPath, commitID string) error
}