Page MenuHomeSoftware Heritage

D8685.diff
No OneTemporary

D8685.diff

diff --git a/src/main/phabricator/utils.lisp b/src/main/phabricator/utils.lisp
--- a/src/main/phabricator/utils.lisp
+++ b/src/main/phabricator/utils.lisp
@@ -117,7 +117,15 @@
(ensure-directories-exist ,cache-path)
(if
(and (probe-file ,cache-path) (not ,override-cache) (not *override-cache*))
- (with-open-file (str ,cache-path) (read str))
+ (let ((data (with-open-file (str ,cache-path) (read str))))
+ (if data ;; let's check if the data is non nil
+ data ;; and return it
+ ;; otherwise, fallbacks to fetch data again and overwrite it
+ (let
+ ((,obj ,item))
+ (with-open-file (str ,cache-path :direction :output :if-exists :supersede)
+ (format str "~S" ,obj))
+ ,obj)))
(let
((,obj ,item))
(with-open-file (str ,cache-path :direction :output :if-exists :supersede)

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 6:56 AM (10 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3230920

Event Timeline