Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123377
D8685.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
856 B
Subscribers
None
D8685.diff
View Options
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
Details
Attached
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
Attached To
D8685: phabricator/utils: Revoke the cache if it's invalid on disk
Event Timeline
Log In to Comment