add option to restrict number of parallel vcs workers

This commit is contained in:
Serge Zaitsev
2018-11-05 09:00:18 +01:00
parent 254fe284ff
commit fc10c1c983
2 changed files with 17 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ func main() {
dir := flag.String("dir", filepath.Join(os.Getenv("HOME"), ".gomodproxy/cache"), "modules cache directory")
gitdir := flag.String("gitdir", filepath.Join(os.Getenv("HOME"), ".gomodproxy/git"), "git cache directory")
memLimit := flag.Int64("mem", 256, "in-memory cache size in MB")
workers := flag.Int("workers", 1, "number of parallel VCS workers")
flag.Var(&gitPaths, "git", "list of git settings")
flag.Parse()
@@ -138,6 +139,7 @@ func main() {
}
options = append(options,
api.VCSWorkers(*workers),
api.GitDir(*gitdir),
api.Memory(logger, *memLimit*1024*1024),
api.CacheDir(*dir),