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 worker: 2
makej: 8 makej: 8
checks: true checks: true
batch: 100
logging: logging:
level: INFO level: INFO

View File

@@ -620,10 +620,14 @@ func (b *BuildManager) syncWorker() {
pkgBuilds, err := Glob(filepath.Join(conf.Basedir.Upstream, "/**/PKGBUILD")) pkgBuilds, err := Glob(filepath.Join(conf.Basedir.Upstream, "/**/PKGBUILD"))
check(err) check(err)
queued := 0
for _, pkgbuild := range pkgBuilds { for _, pkgbuild := range pkgBuilds {
if b.exit { if b.exit {
return return
} }
if queued >= conf.Build.Batch {
break
}
sPkgbuild := strings.Split(pkgbuild, "/") sPkgbuild := strings.Split(pkgbuild, "/")
repo := sPkgbuild[len(sPkgbuild)-2] repo := sPkgbuild[len(sPkgbuild)-2]
@@ -657,6 +661,7 @@ func (b *BuildManager) syncWorker() {
continue continue
} }
queued++
// send to parse // send to parse
for _, march := range conf.March { for _, march := range conf.March {
b.parseWG.Add(1) b.parseWG.Add(1)

View File

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