From 08da93f1a3b99ea81572aeb2e8d0fdfa7b63b0e8 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 2 May 2011 19:28:34 +0200 Subject: [PATCH] (url-queue-run-queue): Pick the first waiting job, and not the last. --- lisp/url/ChangeLog | 2 ++ lisp/url/url-queue.el | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 0bf4d09c95c..55b400e2bd7 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,6 +1,8 @@ 2011-05-02 Lars Magne Ingebrigtsen * url-queue.el: New file. + (url-queue-run-queue): Pick the first waiting job, and not the + last. 2011-04-16 Lars Magne Ingebrigtsen diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el index 2d94d8afea3..d572418e3e2 100644 --- a/lisp/url/url-queue.el +++ b/lisp/url/url-queue.el @@ -67,9 +67,11 @@ controls the level of parallelism via the (let ((running 0) waiting) (dolist (entry url-queue) - (if (url-queue-start-time entry) - (incf running) - (setq waiting entry))) + (cond + ((url-queue-start-time entry) + (incf running)) + ((not waiting) + (setq waiting entry)))) (when (and waiting (< running url-queue-parallel-processes)) (setf (url-queue-start-time waiting) (float-time)) -- 2.39.2