aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2021-03-15 14:06:27 +0000
committerChristopher Baines <mail@cbaines.net>2021-03-15 14:06:27 +0000
commit064ff4c89d232b7ac5fecb3e7084d92d7fabc0d9 (patch)
tree513cef8b1cca6b26af14cd87a7451b80f9bc9cb7
parent4ce712aca41fec9845d0a112eb9603f93b8c32eb (diff)
downloadguix-064ff4c89d232b7ac5fecb3e7084d92d7fabc0d9.tar
guix-064ff4c89d232b7ac5fecb3e7084d92d7fabc0d9.tar.gz
substitutes: lookup-narinfos: Return the number of requests made.
As an additional value, in addition to the narinfos. This value is useful in the weather script for reporting how many requests to the substitute server were made. * guix/substitutes.scm (lookup-narinfos): Additionally return the number of requests made.
-rw-r--r--guix/substitutes.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/guix/substitutes.scm b/guix/substitutes.scm
index ef78013659..08f8c24efd 100644
--- a/guix/substitutes.scm
+++ b/guix/substitutes.scm
@@ -310,13 +310,14 @@ information is available locally."
'()
'()
paths)))
- (if (null? missing)
- cached
- (let ((missing (fetch-narinfos cache missing
- #:open-connection open-connection
- #:make-progress-reporter
- make-progress-reporter)))
- (append cached (or missing '()))))))
+ (values (if (null? missing)
+ cached
+ (let ((missing (fetch-narinfos cache missing
+ #:open-connection open-connection
+ #:make-progress-reporter
+ make-progress-reporter)))
+ (append cached (or missing '()))))
+ (length missing))))
(define* (lookup-narinfos/diverse caches paths authorized?
#:key (open-connection