diff --git a/config_dist.yaml b/config_dist.yaml index d0a7064..5b919c1 100644 --- a/config_dist.yaml +++ b/config_dist.yaml @@ -63,6 +63,7 @@ build: worker: 2 makej: 8 checks: true + batch: 100 logging: level: INFO \ No newline at end of file diff --git a/main.go b/main.go index e4a811a..fcc9ff8 100644 --- a/main.go +++ b/main.go @@ -620,10 +620,14 @@ func (b *BuildManager) syncWorker() { pkgBuilds, err := Glob(filepath.Join(conf.Basedir.Upstream, "/**/PKGBUILD")) check(err) + queued := 0 for _, pkgbuild := range pkgBuilds { if b.exit { return } + if queued >= conf.Build.Batch { + break + } sPkgbuild := strings.Split(pkgbuild, "/") repo := sPkgbuild[len(sPkgbuild)-2] @@ -657,6 +661,7 @@ func (b *BuildManager) syncWorker() { continue } + queued++ // send to parse for _, march := range conf.March { b.parseWG.Add(1) diff --git a/utils.go b/utils.go index 64092f8..dc1d385 100644 --- a/utils.go +++ b/utils.go @@ -84,6 +84,7 @@ type Conf struct { Worker int Makej int Checks bool + Batch int } Logging struct { Level string