added batch limit to not clog up build-queue

This commit is contained in:
2021-11-29 11:07:39 +01:00
parent a013f78937
commit d5cf6989de
3 changed files with 7 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ build:
worker: 2
makej: 8
checks: true
batch: 100
logging:
level: INFO

View File

@@ -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)

View File

@@ -84,6 +84,7 @@ type Conf struct {
Worker int
Makej int
Checks bool
Batch int
}
Logging struct {
Level string