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.
master
Ludovic Courtès 2017-07-21 14:52:08 +02:00 committed by Ludovic Courtès
parent 35eb77b09d
commit deac674ab4
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 2 additions and 1 deletions

View File

@ -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