Skip to content
Permalink
Browse files

Run git repo enumeration in parallel

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
  • Loading branch information...
vmarkovtsev committed Aug 19, 2019
1 parent a4569d2 commit 21bef69aba3ee976785f13f6f5892a8035c7a5b5
Showing with 9 additions and 7 deletions.
  1. +9 −7 PublicGitArchive/pga2uast/pga2uast.go
@@ -128,13 +128,15 @@ func createProgressBar(repos borges.RepositoryIterator) *progress.ProgressBar {
bar.ShowSpeed = false
bar.ShowElapsedTime = true
bar.ShowFinalTime = false
err := repos.ForEach(func(r borges.Repository) error {
bar.Total++
return nil
})
if err != nil {
log.Fatalf("failed to iterate repositories: %v", err)
}
go func() {
err := repos.ForEach(func(r borges.Repository) error {
bar.Total++
return nil
})
if err != nil {
log.Fatalf("failed to iterate repositories: %v", err)
}
}()
return bar
}

0 comments on commit 21bef69

Please sign in to comment.
You can’t perform that action at this time.