~ruther/guix-local

deac674ab4015e52fb6fb883f578e5c5891291a4 — Ludovic Courtès 8 years ago 35eb77b
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.
1 files changed, 2 insertions(+), 1 deletions(-)

M guix/scripts/publish.scm
M guix/scripts/publish.scm => guix/scripts/publish.scm +2 -1
@@ 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