History

Defer Last Commit Info (#16467)

One of the biggest reasons for slow repository browsing is that we wait until last commit information has been generated for all files in the repository. This PR proposes deferring this generation to a new POST endpoint that does the look up outside of the main page request.

zeripath committed 5 years ago

Commit 001dbf11 parent 88fa9f313 files · +321 −151Browse files

Showing the changes to modules/git/last_commit_cache.go (1 of 13 files). Show all

Unified · Split

modules/git/last_commit_cache.go+3−0
@@ -26,6 +26,9 @@ func (c *LastCommitCache) getCacheKey(repoPath, ref, entryPath string) string { · 25 unmodified lines
26 26
27// Put put the last commit id with commit and entry path27// Put put the last commit id with commit and entry path
28func (c *LastCommitCache) Put(ref, entryPath, commitID string) error {28func (c *LastCommitCache) Put(ref, entryPath, commitID string) error {
29 if c == nil || c.cache == nil {
30 return nil
31 }
29 log.Debug("LastCommitCache save: [%s:%s:%s]", ref, entryPath, commitID)32 log.Debug("LastCommitCache save: [%s:%s:%s]", ref, entryPath, commitID)
30 return c.cache.Put(c.getCacheKey(c.repoPath, ref, entryPath), commitID, c.ttl())33 return c.cache.Put(c.getCacheKey(c.repoPath, ref, entryPath), commitID, c.ttl())
31}34}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t