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
1 changed files with 8 additions and 7 deletions

View File

@ -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