guix-commits
[Top][All Lists]
Advanced

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

06/07: publish: Avoid 'valid-path?' RPC for non-existent items.


From: Ludovic Courtès
Subject: 06/07: publish: Avoid 'valid-path?' RPC for non-existent items.
Date: Fri, 21 Jul 2017 11:04:13 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit deac674ab4015e52fb6fb883f578e5c5891291a4
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jul 21 14:52:08 2017 +0200

    publish: Avoid 'valid-path?' RPC for non-existent items.
    
    * guix/scripts/publish.scm (render-narinfo/cached): Call 'file-exists?'
    before calling 'valid-path?'.  This makes the 404 path slightly faster.
---
 guix/scripts/publish.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index cb1abc3..cd57b13 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -417,7 +417,8 @@ requested using POOL."
                      (display (call-with-input-file cached
                                 read-string)
                               port))))
-          ((valid-path? store item)
+          ((and (file-exists? item)        ;cheaper than the 'valid-path?' RPC
+                (valid-path? store item))
            ;; Nothing in cache: bake the narinfo and nar in the background and
            ;; return 404.
            (eventually pool



reply via email to

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