unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#48826] [PATCH] scripts: substitute: Cache connection when looking for narinfos.
@ 2021-06-04  7:02 Mathieu Othacehe
  2021-06-05 20:21 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2021-06-04  7:02 UTC (permalink / raw)
  To: 48826; +Cc: Mathieu Othacehe

The process-substitution procedure is opening two distinct connections. The
first one when looking for narinfo by calling lookup-narinfo and the other one
when fetching nar files.

Cache the connection when looking for narinfos so that process-substitution
only opens one connection.

* guix/scripts/substitute.scm (lookup-narinfo): Cache connection by using
open-connection-for-uri/cached.
---
 guix/scripts/substitute.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm
index 54311c3e08..44448ff3e9 100755
--- a/guix/scripts/substitute.scm
+++ b/guix/scripts/substitute.scm
@@ -163,7 +163,9 @@ if file doesn't exist, and the narinfo otherwise."
 (define (lookup-narinfo caches path authorized?)
   "Return the narinfo for PATH in CACHES, or #f when no substitute for PATH
 was found."
-  (match (lookup-narinfos/diverse caches (list path) authorized?)
+  (match (lookup-narinfos/diverse
+          caches (list path) authorized?
+          #:open-connection open-connection-for-uri/cached)
     ((answer) answer)
     (_        #f)))
 
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#48826] [PATCH] scripts: substitute: Cache connection when looking for narinfos.
  2021-06-04  7:02 [bug#48826] [PATCH] scripts: substitute: Cache connection when looking for narinfos Mathieu Othacehe
@ 2021-06-05 20:21 ` Ludovic Courtès
  2021-06-06 16:56   ` bug#48826: " Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2021-06-05 20:21 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 48826

Hi Mathieu,

Mathieu Othacehe <othacehe@gnu.org> skribis:

> The process-substitution procedure is opening two distinct connections. The
> first one when looking for narinfo by calling lookup-narinfo and the other one
> when fetching nar files.
>
> Cache the connection when looking for narinfos so that process-substitution
> only opens one connection.
>
> * guix/scripts/substitute.scm (lookup-narinfo): Cache connection by using
> open-connection-for-uri/cached.

Good catch, LGTM!

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#48826: [PATCH] scripts: substitute: Cache connection when looking for narinfos.
  2021-06-05 20:21 ` Ludovic Courtès
@ 2021-06-06 16:56   ` Mathieu Othacehe
  0 siblings, 0 replies; 3+ messages in thread
From: Mathieu Othacehe @ 2021-06-06 16:56 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 48826-done


Hey,

> Good catch, LGTM!

Pushed as a068ed6a5f5b3535fce49ac4eca1fec82edd6fdc.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-06 17:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04  7:02 [bug#48826] [PATCH] scripts: substitute: Cache connection when looking for narinfos Mathieu Othacehe
2021-06-05 20:21 ` Ludovic Courtès
2021-06-06 16:56   ` bug#48826: " Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).