aboutsummaryrefslogtreecommitdiff
path: root/guix-qa-frontpage/server.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-07-25 17:21:51 +0100
committerChristopher Baines <mail@cbaines.net>2023-07-25 17:21:51 +0100
commit8854c9df1b5aa4771a86a99811436046305e3ecd (patch)
tree00a03d2e9b9e03cce5afe1e8e1808253c62bc8e4 /guix-qa-frontpage/server.scm
parent0d172558dc1f0b65f4acddeb66864c046dd4b3a1 (diff)
downloadqa-frontpage-8854c9df1b5aa4771a86a99811436046305e3ecd.tar
qa-frontpage-8854c9df1b5aa4771a86a99811436046305e3ecd.tar.gz
Switch to run-server/patched
As run-server was just leading to two schedulers.
Diffstat (limited to 'guix-qa-frontpage/server.scm')
-rw-r--r--guix-qa-frontpage/server.scm25
1 files changed, 17 insertions, 8 deletions
diff --git a/guix-qa-frontpage/server.scm b/guix-qa-frontpage/server.scm
index cddacf7..b9a814e 100644
--- a/guix-qa-frontpage/server.scm
+++ b/guix-qa-frontpage/server.scm
@@ -29,7 +29,7 @@
#:use-module (prometheus)
#:use-module (system repl error-handling)
#:use-module (fibers)
- #:use-module (fibers web server)
+ #:use-module (fibers conditions)
#:use-module (guix store)
#:use-module (guix-data-service web util)
#:use-module ((guix-data-service web query-parameters)
@@ -37,6 +37,8 @@
#:use-module ((guix-build-coordinator utils)
#:select (with-time-logging get-gc-metrics-updater
call-with-delay-logging))
+ #:use-module ((guix-build-coordinator utils fibers)
+ #:select (run-server/patched call-with-sigint))
#:use-module (guix-qa-frontpage database)
#:use-module (guix-qa-frontpage derivation-changes)
#:use-module (guix-qa-frontpage patchwork)
@@ -522,10 +524,17 @@ has no patches or has been closed.")
(apply make-controller assets-directory database metrics-registry
controller-args))
- (run-fibers
- (lambda ()
- (run-server (lambda (request body)
- (apply values (handler request body controller)))
- #:host host
- #:port port))
- #:parallelism 2))
+ (let ((finished? (make-condition)))
+ (call-with-sigint
+ (lambda ()
+ (run-fibers
+ (lambda ()
+ (run-server/patched
+ (lambda (request body)
+ (apply values (handler request body controller)))
+ #:host host
+ #:port port)
+
+ (wait finished?))
+ #:parallelism 2))
+ finished?)))