summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-03-02 20:17:18 +0000
committerChristopher Baines <mail@cbaines.net>2020-04-26 19:37:24 +0100
commitd5abb3049ee4e97865f691eba4c59f5b51de3271 (patch)
tree95222729219ce3ee624aa9c0ddadd3232bd41a1f
parent121191f23ae89415dfbbd3052c7342188cded135 (diff)
downloadguix-d5abb3049ee4e97865f691eba4c59f5b51de3271.tar.gz
substitute: Make http-multiple-get batch size configurable.
* guix/scripts/substitute.scm (http-multiple-get): Add batch-size parameter.
-rwxr-xr-xguix/scripts/substitute.scm5
1 files changed, 3 insertions, 2 deletions
diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 2cb240c2a0..0777aa3d3e 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -494,7 +494,8 @@ MAX-LENGTH first elements."
            (loop (+ 1 len) tail (cons head result)))))))
 
 (define* (http-multiple-get base-uri proc seed requests
-                            #:key port (verify-certificate? #t))
+                            #:key port (verify-certificate? #t)
+                            (batch-size 1000))
   "Send all of REQUESTS to the server at BASE-URI.  Call PROC for each
 response, passing it the request object, the response, a port from which to
 read the response body, and the previous result, starting with SEED, à la
@@ -504,7 +505,7 @@ initial connection on which HTTP requests are sent."
                 (requests requests)
                 (result   seed))
     (define batch
-      (at-most 1000 requests))
+      (at-most batch-size requests))
 
     ;; (format (current-error-port) "connecting (~a requests left)..."
     ;;         (length requests))