From 962459e8ba4c8f3fe486a08f8da7518385a309e2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 10 Nov 2019 01:35:21 -0500 Subject: [PATCH] cli/doctor: fix cache filesize checks Closes #2041 --- core/cli/doctor.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/cli/doctor.el b/core/cli/doctor.el index 2288388a2..bf6ed3a7e 100644 --- a/core/cli/doctor.el +++ b/core/cli/doctor.el @@ -97,11 +97,9 @@ in." (print-group! ;; Check for oversized problem files in cache that may cause unusual/tremendous ;; delays or freezing. This shouldn't happen often. - (dolist (file (list "savehist" - "projectile.cache")) - (let* ((path (expand-file-name file doom-cache-dir)) - (size (/ (doom-file-size path) 1024))) - (when (and (numberp size) (> size 1000)) + (dolist (file (list "savehist" "projectile.cache")) + (when-let (size (ignore-errors (doom-file-size path))) + (when (> size 1048576) ; larger than 1mb (warn! "%s is too large (%.02fmb). This may cause freezes or odd startup delays" (relpath path) (/ size 1024))