forked from ALHP/ALHP.GO
added pkgbuild shuffling back
This commit is contained in:
5
main.go
5
main.go
@@ -16,6 +16,7 @@ import (
|
|||||||
"github.com/wercker/journalhook"
|
"github.com/wercker/journalhook"
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
"html/template"
|
"html/template"
|
||||||
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@@ -670,6 +671,10 @@ 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)
|
||||||
|
|
||||||
|
// Shuffle pkgbuilds to spread out long-running builds, otherwise pkgBuilds is alphabetically-sorted
|
||||||
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
rand.Shuffle(len(pkgBuilds), func(i, j int) { pkgBuilds[i], pkgBuilds[j] = pkgBuilds[j], pkgBuilds[i] })
|
||||||
|
|
||||||
for _, pkgbuild := range pkgBuilds {
|
for _, pkgbuild := range pkgBuilds {
|
||||||
if b.exit {
|
if b.exit {
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user