build-worker are per march now, allows for timely builds

This commit is contained in:
2021-11-29 10:48:29 +01:00
parent 1fc703c6a9
commit a013f78937
3 changed files with 24 additions and 21 deletions

View File

@@ -56,7 +56,7 @@ type BuildPackage struct {
}
type BuildManager struct {
build chan *BuildPackage
build map[string]chan *BuildPackage
parse chan *BuildPackage
repoPurge map[string]chan *BuildPackage
repoAdd map[string]chan *BuildPackage
@@ -753,8 +753,14 @@ func syncMarchs() {
for _, march := range conf.March {
err := setupMakepkg(march)
if err != nil {
log.Errorf("Can't generate makepkg for %s: %v", march, err)
log.Fatalf("Can't generate makepkg for %s: %v", march, err)
}
buildManager.build[march] = make(chan *BuildPackage, 10000)
for i := 0; i < conf.Build.Worker; i++ {
go buildManager.buildWorker(i, march)
}
for _, repo := range conf.Repos {
fRepo := fmt.Sprintf("%s-%s", repo, march)
repos = append(repos, fRepo)