Use persistent-soft's native TTL expiration
Don't need to reinvent the wheel.
This commit is contained in:
parent
8615bf23ca
commit
42a63c661b
1 changed files with 2 additions and 8 deletions
|
@ -9,17 +9,11 @@
|
||||||
(doom-initialize)
|
(doom-initialize)
|
||||||
(when (or force-p (getenv "DEBUG"))
|
(when (or force-p (getenv "DEBUG"))
|
||||||
(doom-refresh-clear-cache))
|
(doom-refresh-clear-cache))
|
||||||
(let ((last-refresh (persistent-soft-fetch 'last-pkg-refresh "emacs")))
|
(unless (persistent-soft-fetch 'last-pkg-refresh "emacs")
|
||||||
(when last-refresh
|
|
||||||
(setq doom--last-refresh last-refresh)))
|
|
||||||
(when (or (not doom--last-refresh)
|
|
||||||
(> (nth 1 (time-since doom--last-refresh)) 900))
|
|
||||||
(condition-case ex
|
(condition-case ex
|
||||||
(progn
|
(progn
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(persistent-soft-store
|
(persistent-soft-store 'last-pkg-refresh t "emacs" 900))
|
||||||
'last-pkg-refresh (setq doom--last-refresh (current-time))
|
|
||||||
"emacs"))
|
|
||||||
('error
|
('error
|
||||||
(doom-refresh-clear-cache)))))
|
(doom-refresh-clear-cache)))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue