org-persist-read: Check expiry

This commit is contained in:
Ihor Radchenko 2022-01-25 23:22:07 +08:00
parent f3bd1dcb77
commit 1bc8389871
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 3 additions and 0 deletions

View File

@ -743,6 +743,9 @@ When LOAD? is non-nil, load the data instead of reading."
(data nil)) (data nil))
(when (and collection (when (and collection
(file-exists-p persist-file) (file-exists-p persist-file)
(or (not (plist-get collection :expiry)) ; current session
(not (org-persist--gc-expired-p
(plist-get collection :expiry) collection)))
(or (not hash-must-match) (or (not hash-must-match)
(and (plist-get associated :hash) (and (plist-get associated :hash)
(equal (plist-get associated :hash) (equal (plist-get associated :hash)