aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in29
1 files changed, 16 insertions, 13 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index 9845e46..c4a4bd2 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -617,19 +617,22 @@
metrics-registry))))
- (when (and (assq-ref opts 'storage)
- (number? (assq-ref opts 'storage-limit)))
- (start-nar-removal-thread database
- canonical-storage
- (assq-ref opts 'storage-limit)
- metrics-registry
- (filter-map
- (match-lambda
- ((key . val)
- (if (eq? key 'storage-nar-removal-criteria)
- val
- #f)))
- opts)))
+ (let ((nar-removal-criteria
+ (filter-map
+ (match-lambda
+ ((key . val)
+ (if (eq? key 'storage-nar-removal-criteria)
+ val
+ #f)))
+ opts)))
+ (when (and (assq-ref opts 'storage)
+ (number? (assq-ref opts 'storage-limit))
+ (not (null? nar-removal-criteria)))
+ (start-nar-removal-thread database
+ canonical-storage
+ (assq-ref opts 'storage-limit)
+ metrics-registry
+ nar-removal-criteria)))
(log-msg 'INFO "starting server, listening on "
(assq-ref opts 'host) ":" (assq-ref opts 'port))