aboutsummaryrefslogtreecommitdiff
path: root/guix/http-client.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-09-26 00:32:12 +0200
committerLudovic Courtès <ludo@gnu.org>2017-09-26 00:35:06 +0200
commit06acf6b52f553efedf4aa95637f198b0cc806a5c (patch)
treed336f1f6dc0818bbc818d6a8f057614aba378b22 /guix/http-client.scm
parent4f80158db069cbd7db4009e577ceee7c4fa54077 (diff)
downloadgnu-guix-06acf6b52f553efedf4aa95637f198b0cc806a5c.tar
gnu-guix-06acf6b52f553efedf4aa95637f198b0cc806a5c.tar.gz
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.
Diffstat (limited to 'guix/http-client.scm')
-rw-r--r--guix/http-client.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/http-client.scm b/guix/http-client.scm
index 853bba4fe3..59788c1f38 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -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)))