mirror of
https://github.com/Jguer/yay.git
synced 2025-10-06 00:05:37 -04:00
Limit download concurrency to 25 threads
This commit is contained in:
parent
2b6a73041f
commit
1beeaaf299
@ -286,9 +286,14 @@ func getPkgbuildsfromABS(pkgs []string, path string) (bool, error) {
|
|||||||
mux.Unlock()
|
mux.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
count := 0
|
||||||
for name, url := range names {
|
for name, url := range names {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go download(name, url)
|
go download(name, url)
|
||||||
|
count++
|
||||||
|
if count%25 == 0 {
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
@ -872,9 +872,14 @@ func downloadPkgbuilds(bases []Base, toSkip stringSet, buildDir string) (stringS
|
|||||||
mux.Unlock()
|
mux.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
count := 0
|
||||||
for k, base := range bases {
|
for k, base := range bases {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go download(k, base)
|
go download(k, base)
|
||||||
|
count++
|
||||||
|
if count%25 == 0 {
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user