From f2e710d44056d410ccf446932b6e13139176bf79 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 12 Jul 2023 08:41:05 +0100 Subject: Drop the number of fibers threads --- scripts/nar-herder.in | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index c20aab7..a75347f 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -648,14 +648,25 @@ (log-msg 'INFO "starting server, listening on " (assq-ref opts 'host) ":" (assq-ref opts 'port)) - (run-server - (make-request-handler database - canonical-storage - #:ttl (assq-ref opts 'narinfo-ttl) - #:negative-ttl (assq-ref opts 'narinfo-negative-ttl) - #:logger lgr - #:metrics-registry metrics-registry - #:maybe-trigger-creation-of-compressed-nars - maybe-trigger-creation-of-compressed-nars) - #:host (assq-ref opts 'host) - #:port (assq-ref opts 'port)))))) + + (let ((finished? (make-condition))) + (call-with-sigint + (lambda () + (run-fibers + (lambda () + (run-server/patched + (make-request-handler database + canonical-storage + #:ttl (assq-ref opts 'narinfo-ttl) + #:negative-ttl (assq-ref opts 'narinfo-negative-ttl) + #:logger lgr + #:metrics-registry metrics-registry + #:maybe-trigger-creation-of-compressed-nars + maybe-trigger-creation-of-compressed-nars) + #:host (assq-ref opts 'host) + #:port (assq-ref opts 'port)) + + (wait finished?)) + #:hz 5 + #:parallelism 4)) + finished?)))))) -- cgit v1.2.3