diff options
Diffstat (limited to 'bffe.scm')
-rw-r--r-- | bffe.scm | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -22,6 +22,12 @@ #:use-module (prometheus) #:use-module (logging logger) #:use-module (logging port-log) + #:use-module (fibers) + #:use-module (fibers scheduler) + #:use-module (fibers channels) + #:use-module (fibers conditions) + #:use-module ((guix-build-coordinator utils fibers) + #:select (call-with-sigint)) #:use-module (bffe server) #:use-module (bffe manage-builds) #:export (run-bffe-service)) @@ -51,10 +57,19 @@ (open-log! lgr) (set-default-logger! lgr) - (for-each start-submit-builds-thread - build) + (let ((finished? (make-condition))) + (call-with-sigint + (lambda () + (run-fibers + (lambda () + (for-each start-submit-builds-fibers + build) - (apply start-bffe-web-server - `(,@web-server-args - #:pid-file ,pid-file - #:metrics-registry ,metrics-registry)))) + (apply start-bffe-web-server + `(,@web-server-args + #:pid-file ,pid-file + #:metrics-registry ,metrics-registry)) + (wait finished?)) + #:hz 10 + #:parallelism 4)) + finished?)))) |