[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/backports-25.2 aad7ede 07/46: Ensure progress when
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] scratch/backports-25.2 aad7ede 07/46: Ensure progress when fetching from the queue |
Date: |
Sun, 2 Oct 2016 14:04:47 +0000 (UTC) |
branch: scratch/backports-25.2
commit aad7ede227cd1a65780cf6a8cb500d6582315d22
Author: Lars Ingebrigtsen <address@hidden>
Commit: Noam Postavsky <address@hidden>
Ensure progress when fetching from the queue
* lisp/url/url-queue.el (url-queue-check-progress): Ensure
that we have progress when fetching queued requests (bug#22576).
(cherry picked from commit da66e5585083c2c357e960144fd4ae0e75310f74)
---
lisp/url/url-queue.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 0ff4ad1..8972d0b 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -1,4 +1,4 @@
-;;; url-queue.el --- Fetching web pages in parallel
+;;; url-queue.el --- Fetching web pages in parallel -*- lexical-binding: t
-*-
;; Copyright (C) 2011-2016 Free Software Foundation, Inc.
@@ -47,6 +47,7 @@
;;; Internal variables.
(defvar url-queue nil)
+(defvar url-queue-progress-timer nil)
(cl-defstruct url-queue
url callback cbargs silentp
@@ -90,7 +91,13 @@ The variable `url-queue-timeout' sets a timeout."
(when (and waiting
(< running url-queue-parallel-processes))
(setf (url-queue-pre-triggered waiting) t)
- (run-with-idle-timer 0.01 nil 'url-queue-run-queue))))
+ ;; We start fetching from this idle timer...
+ (run-with-idle-timer 0.01 nil #'url-queue-run-queue)
+ ;; And then we set up a separate timer to ensure progress when a
+ ;; web server is unresponsive.
+ (unless url-queue-progress-timer
+ (setq url-queue-progress-timer
+ (run-with-idle-timer 1 1 #'url-queue-check-progress))))))
(defun url-queue-run-queue ()
(url-queue-prune-old-entries)
@@ -107,6 +114,13 @@ The variable `url-queue-timeout' sets a timeout."
(setf (url-queue-start-time waiting) (float-time))
(url-queue-start-retrieve waiting))))
+(defun url-queue-check-progress ()
+ (when url-queue-progress-timer
+ (if url-queue
+ (url-queue-run-queue)
+ (cancel-timer url-queue-progress-timer)
+ (setq url-queue-progress-timer nil))))
+
(defun url-queue-callback-function (status job)
(setq url-queue (delq job url-queue))
(when (and (eq (car status) :error)
- [Emacs-diffs] scratch/backports-25.2 1cd6309 14/46: Allow ff-find-other-file (etc) to work with indirect clone buffers, (continued)
- [Emacs-diffs] scratch/backports-25.2 1cd6309 14/46: Allow ff-find-other-file (etc) to work with indirect clone buffers, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 5c084d9 10/46: Remove spurious newline in package list, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 80cf0b6 21/46: Restore the fix to bug#18527 from commit d6868025, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 51656da 28/46: Fix number-at-point in lisp buffers, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 0876366 43/46: Fix back-white <-> black-white typo, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 f3a19cf 31/46: Make a menu less ambiguous, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 12d1955 41/46: * lisp/files.el (version-control): Drop :group vc (Bug #14687), Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 cf54324 42/46: Improve error when installing non-package dirs, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 9e9f7c8 45/46: Don't --load directories, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 eb5dd2c 46/46: Don't require isearch-update before isearch-done, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 aad7ede 07/46: Ensure progress when fetching from the queue,
Noam Postavsky <=
- [Emacs-diffs] scratch/backports-25.2 87a7490 35/46: Clarify `read-face-name' doc and tweak the code, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 171ec16 44/46: Avoid error in icalendar--read-element, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 a33eb50 03/46: Let url use default file modes when copying files, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 30376cc 22/46: Allow _ characters in SQL prompts, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 145e369 05/46: Make the nsm query say what it did after the user interaction, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 e1e768e 01/46: Default web pages to right-to-left, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 b16e6c3 09/46: Require that the buffer that we're trying to patch exist, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 e2e25ae 20/46: Make <div> in <li> not insert extra newlines, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 77c3f7f 24/46: Make `q' etc work in image mode again, Noam Postavsky, 2016/10/02
- [Emacs-diffs] scratch/backports-25.2 d7de0c4 25/46: smtpmail would say it's done before it is, Noam Postavsky, 2016/10/02