mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 23:00:58 +00:00
Do initial repository scan in parallel (ref #210)
This commit is contained in:
parent
0d3caa2183
commit
21335d65c4
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user