diff options
Diffstat (limited to 'projectile.el')
| -rw-r--r-- | projectile.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/projectile.el b/projectile.el index c4c0154..977860e 100644 --- a/projectile.el +++ b/projectile.el @@ -1221,6 +1221,16 @@ The cache is created both in memory and on the hard drive." (when (file-exists-p cache-file) (when-let* ((data (projectile-unserialize cache-file))) (puthash project-root data projectile-projects-cache) + ;; Seed the cache time from the file's mtime so the TTL check in + ;; `projectile-project-files' can decide whether the loaded data is + ;; already stale, and so the in-memory entry isn't evicted on the + ;; next call just because no time was recorded. + (puthash project-root + (time-convert + (file-attribute-modification-time + (file-attributes cache-file)) + 'integer) + projectile-projects-cache-time) data)))) ;;;###autoload |
