summaryrefslogtreecommitdiff
path: root/guix/scripts/publish.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2017-07-21 14:52:08 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-21 17:03:25 +0200
commitdeac674ab4015e52fb6fb883f578e5c5891291a4 (patch)
tree652b1b41618b09c130c25dfd46d0e6201f5599b5 /guix/scripts/publish.scm
parent35eb77b09d957019b2437e7681bd88013d67d3cd (diff)
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.
Diffstat (limited to 'guix/scripts/publish.scm')
-rw-r--r--guix/scripts/publish.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index cb1abc32fb..cd57b13dc3 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