mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-07 07:22:04 +00:00
fix: git cache (#38763)
1. always use "last commit cache" 2. correctly build the cache key for any input (SafeCacheKey) 3. fix the git note "last commit cache FIXME" and avoid OOM
This commit is contained in:
@@ -132,14 +132,8 @@ func testViewRepoWithCache(t *testing.T) {
|
||||
}
|
||||
|
||||
// FIXME: these test don't seem quite right, no enough assert
|
||||
// no last commit cache
|
||||
testView(t)
|
||||
// enable last commit cache for all repositories
|
||||
defer test.MockVariableValue(&setting.CacheService.LastCommit.CommitsCount, 0)()
|
||||
// first view will not hit the cache
|
||||
testView(t)
|
||||
// second view will hit the cache
|
||||
testView(t)
|
||||
testView(t) // first view will not hit the cache, need execute git operations
|
||||
testView(t) // second view will hit the cache
|
||||
}
|
||||
|
||||
func testViewRepoPrivate(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user