From deac674ab4015e52fb6fb883f578e5c5891291a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 21 Jul 2017 14:52:08 +0200 Subject: 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 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 -- cgit v1.2.3