mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-22 01:45:12 +09:00
Backport #40451 by @silverwind The dashboard repo list read the entire `commit_status_summary` table on every load when the page held an empty repo and the other repos' statuses were cached, about 1.2 s with 1M rows. Those other repos also showed and cached the status of an arbitrary older commit. Also fixes the MySQL upsert not updating `target_url`. Assisted-by: Claude Code:claude-opus-5-5 Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
1 parent
62e9f747e8
commit
2d84f79e3b
2 files changed
+12
-2
No files matched your search
@@ -89,6 +89,13 @@ func TestGetCommitStatuses(t *testing.T) {
|
||||
"deploy/awesomeness": 5,
|
||||
}, latestIndexes)
|
||||
})
|
||||
|
||||
t.Run("GetLatestCommitStatusForRepoAndSHAsEmpty", func(t *testing.T) {
|
||||
assert.NoError(t, git_model.UpdateCommitStatusSummary(t.Context(), repo1.ID, sha1))
|
||||
statuses, err := git_model.GetLatestCommitStatusForRepoAndSHAs(t.Context(), nil)
|
||||
assert.NoError(t, err)
|
||||
assert.Empty(t, statuses)
|
||||
})
|
||||
}
|
||||
|
||||
func Test_CalcCommitStatus(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user