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.
This commit is contained in:
Christopher Baines 2021-03-15 14:06:27 +00:00
parent b48204259a
commit c5ab78f90b
No known key found for this signature in database
GPG key ID: 5E28A33B0B84F577

View file

@ -310,13 +310,14 @@ (define* (lookup-narinfos cache paths
'() '()
'() '()
paths))) paths)))
(if (null? missing) (values (if (null? missing)
cached cached
(let ((missing (fetch-narinfos cache missing (let ((missing (fetch-narinfos cache missing
#:open-connection open-connection #:open-connection open-connection
#:make-progress-reporter #:make-progress-reporter
make-progress-reporter))) make-progress-reporter)))
(append cached (or missing '())))))) (append cached (or missing '()))))
(length missing))))
(define* (lookup-narinfos/diverse caches paths authorized? (define* (lookup-narinfos/diverse caches paths authorized?
#:key (open-connection #:key (open-connection