This commit is contained in:
Lunny Xiao 2025-04-29 09:52:08 -07:00
parent 35497493c8
commit 004e3bbe23
2 changed files with 5 additions and 5 deletions

View File

@ -1886,9 +1886,6 @@ LEVEL = Info
;; Time to keep items in cache if not used, default is 8760 hours. ;; Time to keep items in cache if not used, default is 8760 hours.
;; Setting it to -1 disables caching ;; Setting it to -1 disables caching
;ITEM_TTL = 8760h ;ITEM_TTL = 8760h
;;
;; Only enable the cache when repository's commits count great than
;COMMITS_COUNT = 1000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -81,7 +81,7 @@ func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
return nil, err return nil, err
} }
return &Repository{ repo := &Repository{
Path: repoPath, Path: repoPath,
gogitRepo: gogitRepo, gogitRepo: gogitRepo,
gogitStorage: storage, gogitStorage: storage,
@ -89,7 +89,10 @@ func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) {
commitCache: make(map[string]*Commit), commitCache: make(map[string]*Commit),
Ctx: ctx, Ctx: ctx,
objectFormat: ParseGogitHash(plumbing.ZeroHash).Type(), objectFormat: ParseGogitHash(plumbing.ZeroHash).Type(),
}, nil }
repo.lastCommitCache = newLastCommitCache(repo.Path, repo, cache.GetCache())
return repo, nil
} }
// Close this repository, in particular close the underlying gogitStorage if this is not nil // Close this repository, in particular close the underlying gogitStorage if this is not nil