increase unknown build limit to 2
This commit is contained in:
@@ -18,6 +18,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const MaxUnknownBuilder = 2
|
||||||
|
|
||||||
type BuildManager struct {
|
type BuildManager struct {
|
||||||
repoPurge map[string]chan []*ProtoPackage
|
repoPurge map[string]chan []*ProtoPackage
|
||||||
repoAdd map[string]chan []*ProtoPackage
|
repoAdd map[string]chan []*ProtoPackage
|
||||||
@@ -124,7 +126,7 @@ func (b *BuildManager) buildQueue(queue []*ProtoPackage, ctx context.Context) er
|
|||||||
for len(doneQ) != len(queue) {
|
for len(doneQ) != len(queue) {
|
||||||
up := 0
|
up := 0
|
||||||
b.buildingLock.RLock()
|
b.buildingLock.RLock()
|
||||||
if (pkgList2MaxMem(b.building) < conf.Build.MemoryLimit && !unknownBuilds && !queueNoMatch) || (unknownBuilds && len(b.building) < 1) {
|
if (pkgList2MaxMem(b.building) < conf.Build.MemoryLimit && !unknownBuilds && !queueNoMatch) || (unknownBuilds && len(b.building) < MaxUnknownBuilder) {
|
||||||
queueNoMatch = true
|
queueNoMatch = true
|
||||||
b.buildingLock.RUnlock()
|
b.buildingLock.RUnlock()
|
||||||
for _, pkg := range queue {
|
for _, pkg := range queue {
|
||||||
@@ -156,7 +158,7 @@ func (b *BuildManager) buildQueue(queue []*ProtoPackage, ctx context.Context) er
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if package can be build with current memory limit
|
// check if package can be built with current memory limit
|
||||||
if datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB > conf.Build.MemoryLimit {
|
if datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB > conf.Build.MemoryLimit {
|
||||||
log.Warningf("[Q] %s->%s exeeds memory limit: %s->%s", pkg.FullRepo, pkg.Pkgbase,
|
log.Warningf("[Q] %s->%s exeeds memory limit: %s->%s", pkg.FullRepo, pkg.Pkgbase,
|
||||||
datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB, conf.Build.MemoryLimit)
|
datasize.ByteSize(*pkg.DBPackage.MaxRss)*datasize.KB, conf.Build.MemoryLimit)
|
||||||
@@ -178,7 +180,7 @@ func (b *BuildManager) buildQueue(queue []*ProtoPackage, ctx context.Context) er
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
b.buildingLock.RLock()
|
b.buildingLock.RLock()
|
||||||
if len(b.building) >= 1 {
|
if len(b.building) >= MaxUnknownBuilder {
|
||||||
b.buildingLock.RUnlock()
|
b.buildingLock.RUnlock()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user