aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-07-12 08:41:05 +0100
committerChristopher Baines <mail@cbaines.net>2023-07-12 08:41:05 +0100
commitf2e710d44056d410ccf446932b6e13139176bf79 (patch)
treea7ae20ca69ca52ddd6f2eb133ad8b2539734184f /scripts
parentf59df23d625c3c48e13c52fa6038df084a548b51 (diff)
downloadnar-herder-f2e710d44056d410ccf446932b6e13139176bf79.tar
nar-herder-f2e710d44056d410ccf446932b6e13139176bf79.tar.gz
Drop the number of fibers threads
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in33
1 files changed, 22 insertions, 11 deletions
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?))))))