[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#39873] [PATCH 2/3] substitute: Make http-multiple-get batch size co

From: Christopher Baines
Subject: [bug#39873] [PATCH 2/3] substitute: Make http-multiple-get batch size configurable.
Date: Mon, 2 Mar 2020 21:07:34 +0000

* guix/scripts/substitute.scm (http-multiple-get): Add batch-size parameter.
 guix/scripts/substitute.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 5ed43d36c9..a88cb5bcfe 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -501,7 +501,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
@@ -511,7 +512,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))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]