2010-09-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * mail-source.el (mail-source-delete-crash-box): Only check the
+ incoming files for deletion once per day to save a lot of file
+ accesses.
+
* pop3.el (pop3-logon): Fix up unbound variable typo.
* mail-source.el (pop3-streaming-movemail): Autoload.
0)
(funcall callback mail-source-crash-box info)))
+(defvar mail-source-incoming-last-checked-time nil)
+
(defun mail-source-delete-crash-box ()
(when (file-exists-p mail-source-crash-box)
;; Delete or move the incoming mail out of the way.
(if (eq mail-source-delete-incoming t)
(delete-file mail-source-crash-box)
+ ;; Don't check for old incoming files more than once per day to
+ ;; save a lot of file accesses.
+ (when (or (null mail-source-incoming-last-checked-time)
+ (> (time-to-seconds
+ (time-since mail-source-incoming-last-checked-time))
+ (* 24 60 60)))
+ (setq mail-source-incoming-last-checked-time (current-time)))
(let ((incoming
(mm-make-temp-file
(expand-file-name