diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2017-07-21 14:52:08 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-07-21 17:03:25 +0200 |
commit | deac674ab4015e52fb6fb883f578e5c5891291a4 (patch) | |
tree | 652b1b41618b09c130c25dfd46d0e6201f5599b5 | |
parent | 35eb77b09d957019b2437e7681bd88013d67d3cd (diff) | |
download | patches-deac674ab4015e52fb6fb883f578e5c5891291a4.tar patches-deac674ab4015e52fb6fb883f578e5c5891291a4.tar.gz |
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.
-rw-r--r-- | guix/scripts/publish.scm | 3 |
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 |