Monorepo for Tangled tangled.org
856
fork

Configure Feed

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

appview/db/repos: calculate the fork count of a repo #355

open opened by willdot.net targeting master from willdot.net/tangled-fork-2: repo-fork-counts

Signed-off-by: Will did:plc:dadhhalkfcq3gucaq25hjqon

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:dadhhalkfcq3gucaq25hjqon/sh.tangled.repo.pull/3mlgnel3pcn22
+12 -5
Interdiff #0 โ†’ #1
+12 -5
appview/db/repos.go
··· 321 321 } 322 322 defer rows.Close() 323 323 324 + repoDidMap := make(map[string]syntax.ATURI) 325 + for aturi, repo := range repoMap { 326 + repoDidMap[repo.RepoDid] = aturi 327 + } 328 + 324 329 for rows.Next() { 325 330 var repodid string 326 331 var count int ··· 329 334 continue 330 335 } 331 336 332 - for _, r := range repoMap { 333 - if r.RepoDid == repodid { 334 - r.RepoStats.ForkCount = count 335 - break 336 - } 337 + atURI, ok := repoDidMap[repodid] 338 + if !ok { 339 + continue 340 + } 341 + 342 + if r, ok := repoMap[atURI]; ok { 343 + r.RepoStats.ForkCount = count 337 344 } 338 345 } 339 346 if err = rows.Err(); err != nil {
appview/models/repo.go

This file has not been changed.

History

4 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/db/repos: calculate the fork count of a repo
merge conflicts detected
expand
  • appview/db/repos.go:301
  • appview/models/repo.go:97
expand 0 comments
1 commit
expand
appview/db/repos: calculate the fork count of a repo
expand 0 comments
1 commit
expand
appview/db/repos: calculate the fork count of a repo
expand 0 comments
1 commit
expand
appview/db/repos: calculate the fork count of a repo
expand 0 comments