~ruther/guix-local

06acf6b52f553efedf4aa95637f198b0cc806a5c — Ludovic Courtès 8 years ago 4f80158
http-client: Reset cache TTL upon 304 "Not Modified" responses.

* guix/http-client.scm (http-fetch/cached)[update-cache]: Add call to
'utime' in the 304 case.
1 files changed, 3 insertions(+), 1 deletions(-)

M guix/http-client.scm
M guix/http-client.scm => guix/http-client.scm +3 -1
@@ 321,7 321,9 @@ Raise an '&http-get-error' condition if downloading fails."
      ;; Update the cache and return an input port.
      (guard (c ((http-get-error? c)
                 (if (= 304 (http-get-error-code c)) ;"Not Modified"
                     cache-port
                     (begin
                       (utime file)               ;update FILE's mtime
                       cache-port)
                     (raise c))))
        (let ((port (http-fetch uri #:text? text?
                                #:headers headers)))