branch: externals/el-job
commit 1ec555a64ea6ae3eedd6fedfcb6432117321930e
Author: Martin Edström <meedst...@runbox.eu>
Commit: Martin Edström <meedst...@runbox.eu>

    Recover from an error
---
 el-job.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/el-job.el b/el-job.el
index 0e689447ab..d310e764b1 100644
--- a/el-job.el
+++ b/el-job.el
@@ -635,9 +635,13 @@ after a short delay.  N is the count of checks done so 
far."
                     (run-with-timer
                      (/ n 32.0) nil #'el-job--poll (1+ n) busy-bufs))
             (el-job--disable el-job-here)
-            (message "el-job: Timed out, was busy for 30+ seconds: %s"
-                     (el-job-id el-job-here)))
-        (cl-assert (not (member (el-job-timer el-job-here) timer-list)))
+            (el-job--dbg 0 "Timed out, was busy for 30+ seconds: %s"
+                         (el-job-id el-job-here)))
+        (when (member (el-job-timer el-job-here) timer-list)
+          ;; It does, somehow, happen
+          ;; https://github.com/meedstrom/org-node/issues/94
+          (el-job--dbg 1 "Timer still active (this is a bug), recovering")
+          (cancel-timer (el-job-timer el-job-here)))
         (setf (el-job-timer el-job-here)
               (run-with-timer 30 nil #'el-job--reap (current-buffer)))))))
 

Reply via email to