aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-11-23 10:31:15 +0000
committerChristopher Baines <mail@cbaines.net>2023-11-23 10:31:15 +0000
commit5ccd6cbbdf5fc41e43a491d3414c1663e1fba64d (patch)
tree37880d66ccf4fa83d392eb5fae60b4e806ff7a8a
parentbf539aa08edfe8010606a31c00e0296c3d400319 (diff)
downloadnar-herder-5ccd6cbbdf5fc41e43a491d3414c1663e1fba64d.tar
nar-herder-5ccd6cbbdf5fc41e43a491d3414c1663e1fba64d.tar.gz
Don't allow the mirror and removal channel to be unspecified
As this is truthy.
-rw-r--r--nar-herder/server.scm30
1 files changed, 16 insertions, 14 deletions
diff --git a/nar-herder/server.scm b/nar-herder/server.scm
index 7aa4115..9153055 100644
--- a/nar-herder/server.scm
+++ b/nar-herder/server.scm
@@ -698,12 +698,13 @@
mirror
metrics-registry)
- (when (assq-ref opts 'storage)
- (start-mirroring-fiber database
- mirror
- (assq-ref opts 'storage-limit)
- canonical-storage
- metrics-registry)))))
+ (if (assq-ref opts 'storage)
+ (start-mirroring-fiber database
+ mirror
+ (assq-ref opts 'storage-limit)
+ canonical-storage
+ metrics-registry)
+ #f))))
(removal-channel
(let ((nar-removal-criteria
(filter-map
@@ -713,14 +714,15 @@
val
#f)))
opts)))
- (when (and (assq-ref opts 'storage)
- (number? (assq-ref opts 'storage-limit))
- (not (null? nar-removal-criteria)))
- (start-nar-removal-fiber database
- canonical-storage
- (assq-ref opts 'storage-limit)
- metrics-registry
- nar-removal-criteria))))
+ (if (and (assq-ref opts 'storage)
+ (number? (assq-ref opts 'storage-limit))
+ (not (null? nar-removal-criteria)))
+ (start-nar-removal-fiber database
+ canonical-storage
+ (assq-ref opts 'storage-limit)
+ metrics-registry
+ nar-removal-criteria)
+ #f)))
(addition-channel (make-channel)))
(spawn-fiber