create jobs queue for scheduling new builds

This commit is contained in:
Martin Sehnoutka 2019-09-24 15:58:16 +02:00 committed by Tom Gundersen
parent 7df735e36b
commit 0861b80c99
5 changed files with 150 additions and 9 deletions

View file

@ -11,6 +11,7 @@ import (
"os/signal"
"path/filepath"
"osbuild-composer/internal/queue"
"osbuild-composer/internal/rpmmd"
"osbuild-composer/internal/weldr"
)
@ -59,7 +60,8 @@ func main() {
}
stateChannel := make(chan []byte, 10)
api := weldr.New(repo, packages, logger, state, stateChannel)
buildChannel := make(chan queue.Build, 200)
api := weldr.New(repo, packages, logger, state, stateChannel, buildChannel)
go func() {
for {
err := writeFileAtomically(StateFile, <-stateChannel, 0755)