Skip to content

Commit

Permalink
update comments and logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Aug 23, 2023
1 parent 9ae7230 commit 282a332
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/sources/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Source struct {
filteredRepoCache *filteredRepoCache
memberCache map[string]struct{}
repoSizes repoSize
totalRepoSize int // total size in bytes of all repos
totalRepoSize int // total size of all repos in kb
git *git.Git

scanOptMu sync.Mutex // protects the scanOptions
Expand Down Expand Up @@ -116,7 +116,7 @@ func (s *Source) JobID() int64 {

type repoSize struct {
mu sync.RWMutex
repoSizes map[string]int // size in bytes of each repo
repoSizes map[string]int // size in kb of each repo
}

func (r *repoSize) addRepo(repo string, size int) {
Expand Down Expand Up @@ -775,7 +775,7 @@ func (s *Source) scan(ctx context.Context, installationClient *github.Client, ch
s.setScanOptions(s.conn.Base, s.conn.Head)

repoSize := s.repoSizes.getRepo(repoURL)
logger.V(2).Info(fmt.Sprintf("scanning repo %d/%d", i, len(s.repos)), "repo_size", repoSize)
logger.V(2).Info(fmt.Sprintf("scanning repo %d/%d", i, len(s.repos)), "repo_size_bytes", repoSize)

now := time.Now()
defer func(start time.Time) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/sources/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (s *Source) processRepos(ctx context.Context, target string, listRepos repo
s.repoSizes.addRepo(repoURL, r.GetSize())
s.totalRepoSize += r.GetSize()
s.filteredRepoCache.Set(repoName, repoURL)
logger.V(3).Info("repo attributes", "name", repoName, "size", r.GetSize(), "repo_url", repoURL)
logger.V(3).Info("repo attributes", "name", repoName, "kb_size", r.GetSize(), "repo_url", repoURL)
}

if res.NextPage == 0 {
Expand Down

0 comments on commit 282a332

Please sign in to comment.