Skip to content
Snippets Groups Projects
Commit f63095ae authored by Bensong Liu's avatar Bensong Liu
Browse files

goroutine count limit

parent dd2b07b0
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ import (
// Some options here. Would be improved in beta release.
const DEDUCT_PKGNAME_FROM_VARNAME = true
const USE_PROJECT_NETVER_INSTEAD_OF_HINTPATH_NETVER = false
const OPENXT_VERSION = "1.1b"
const OPENXT_VERSION = "1.1b-2"
func print_help_and_exit() {
println("Usage: openxt <subcommand> [options...]")
......
......@@ -28,16 +28,16 @@ func ScanForDependencies(scanPath string) (allDeps []dependencyItem) {
// Download `allDeps` to localRepoPath, with nuget.config from nugetConfigPath.
// However, nugetConfigPath is not supported now. We use default nuget.config now. (Usually in ~/.nuget/)
func SyncPackages(nugetConfigPath, localRepoPath string, allDeps []dependencyItem) {
log.Println("WARNING: We do not support custom nugetConfigPath yet. Please make sure your default nuget.config works. (usually ~/.nuget/NuGet/NuGet.Config)")
// Prepare nuget local repo
depsToSync := depsDeduplicate(allDeps)
var wg sync.WaitGroup
concurrencyLimitChan := make(chan int, 64)
for index_, dep_ := range depsToSync {
wg.Add(1)
concurrencyLimitChan <- 1 // will block if there's already 64 goroutine running
go func(index int, dep dependencyItem) {
defer wg.Done()
defer func() {<-concurrencyLimitChan ; wg.Done()}()
log.Printf("[%v/%v] Begin downloading: %v:%v as var %v", index, len(depsToSync), dep.pkgName, dep.targetNetVer, dep.envName)
log.Println("nuget-download-package", dep.pkgName, dep.targetNetVer, localRepoPath, nugetConfigPath)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment