guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/05: http-client: Reset cache TTL upon 304 "Not Modified" responses.


From: Ludovic Courtès
Subject: 05/05: http-client: Reset cache TTL upon 304 "Not Modified" responses.
Date: Mon, 25 Sep 2017 18:35:30 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 06acf6b52f553efedf4aa95637f198b0cc806a5c
Author: Ludovic Courtès <address@hidden>
Date:   Tue Sep 26 00:32:12 2017 +0200

    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.
---
 guix/http-client.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/http-client.scm b/guix/http-client.scm
index 853bba4..59788c1 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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]