Do initial repository scan in parallel (ref #210)

This commit is contained in:
Jakob Borg 2014-05-13 20:42:12 -03:00
parent 0d3caa2183
commit 21335d65c4

View File

@ -556,9 +556,16 @@ func (m *Model) ScanRepos() {
} }
m.rmut.RUnlock() m.rmut.RUnlock()
var wg sync.WaitGroup
wg.Add(len(repos))
for _, repo := range repos { for _, repo := range repos {
repo := repo
go func() {
m.ScanRepo(repo) m.ScanRepo(repo)
wg.Done()
}()
} }
wg.Wait()
} }
func (m *Model) ScanRepo(repo string) error { func (m *Model) ScanRepo(repo string) error {