From 2a2764b12094ec012d63e769f0bed7a6daa98d3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kr=C3=BCger?= Date: Fri, 5 Nov 2010 05:10:41 +0100 Subject: [PATCH] jobd: keep processing queue properly near the end MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously, jobd forgot to check periodically for status updates when only a few running jobs and no queued jobs were left, instead checking in a tight loop. Instead, make it sleep even then. Signed-off-by: Jan Krüger --- jobd/jobd.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jobd/jobd.pl b/jobd/jobd.pl index bd7217d..df6bc94 100755 --- a/jobd/jobd.pl +++ b/jobd/jobd.pl @@ -217,7 +217,7 @@ sub run_queue { reap_hanging_jobs(); reap_finished_jobs(); # Back off if we're too busy - if (@running >= $max_par) { + if (@running >= $max_par || !@queue) { sleep 10; if ($progress && (time - $last_progress) >= 60) { printf STDERR "STATUS: %d queued, %d running, %d finished, %d skipped, %d killed\n", scalar(@queue), scalar(@running), $jobs_executed, $jobs_skipped, scalar(@jobs_killed); -- 2.11.4.GIT