This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

appview/repo: fetch pipeline statuses concurrently on index

Signed-off-by: dawn <dawn@tangled.org>

author
dawn
date (Jul 16, 2026, 6:02 PM +0300) commit aa2f9752 parent 2b8f585b change-id mumvvwum
+18 -7
+18 -7
appview/repo/index.go
··· 113 113 tagsTrunc := result.Tags[:min(tagCount, len(result.Tags))] 114 114 branchesTrunc := result.Branches[:min(branchCount, len(result.Branches))] 115 115 116 + var shas []string 117 + for _, c := range commitsTrunc { 118 + shas = append(shas, c.Hash.String()) 119 + } 120 + type pipelineResult struct { 121 + pipelines map[string]types.Pipeline 122 + err error 123 + } 124 + pipelineCh := make(chan pipelineResult, 1) 125 + go func() { 126 + p, err := getPipelineStatuses(r.Context(), f, shas) 127 + pipelineCh <- pipelineResult{p, err} 128 + }() 129 + 116 130 emails := uniqueEmails(commitsTrunc) 117 131 emailToDidMap, err := db.GetEmailToDid(rp.db, emails, true) 118 132 if err != nil { ··· 173 187 } 174 188 } 175 189 176 - var shas []string 177 - for _, c := range commitsTrunc { 178 - shas = append(shas, c.Hash.String()) 179 - } 180 - pipelines, err := getPipelineStatuses(r.Context(), f, shas) 181 - if err != nil { 182 - l.Error("failed to fetch pipeline statuses", "err", err) 190 + pr := <-pipelineCh 191 + if pr.err != nil { 192 + l.Error("failed to fetch pipeline statuses", "err", pr.err) 183 193 // non-fatal 184 194 } 195 + pipelines := pr.pipelines 185 196 186 197 rp.pages.RepoIndexPage(w, pages.RepoIndexParams{ 187 198 BaseParams: pages.BaseParamsFromContext(r.Context()),