From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:43444) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8sIG-0006Oi-1r for guix-patches@gnu.org; Mon, 02 Mar 2020 16:08:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j8sIF-0003GH-4P for guix-patches@gnu.org; Mon, 02 Mar 2020 16:08:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60683) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j8sIF-0003G5-0A for guix-patches@gnu.org; Mon, 02 Mar 2020 16:08:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j8sIE-0001v3-Sh for guix-patches@gnu.org; Mon, 02 Mar 2020 16:08:02 -0500 Subject: [bug#39873] [PATCH 2/3] substitute: Make http-multiple-get batch size configurable. Resent-Message-ID: From: Christopher Baines Date: Mon, 2 Mar 2020 21:07:34 +0000 Message-Id: <20200302210735.13337-2-mail@cbaines.net> In-Reply-To: <20200302210735.13337-1-mail@cbaines.net> References: <87imjmeagu.fsf@cbaines.net> <20200302210735.13337-1-mail@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39873@debbugs.gnu.org * 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)) -- 2.25.0