From 768398d585b185d1ca5fae33d11d97fffcf00c87 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kr=C3=BCger?= Date: Sun, 21 Nov 2010 15:08:05 +0100 Subject: [PATCH] jobd: take a short break after each queue run MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit If all repositories are free of errors, jobd will finish each run of the queue extremely quickly. In anticipation of this (admittedly quite unlikely) event, make it rest a bit every time it completes all jobs. Signed-off-by: Jan Krüger --- jobd/jobd.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobd/jobd.pl b/jobd/jobd.pl index 05c3a46..54d26a0 100755 --- a/jobd/jobd.pl +++ b/jobd/jobd.pl @@ -22,6 +22,7 @@ my $kill_after = 900; my $max_par = 20; my $max_par_intensive = 1; my $lockfile = "/tmp/jobd.lock"; +my $restart_delay = 10; # not currently configurable my $all_once; my $one; @@ -296,6 +297,7 @@ sub run_perpetually { while ($perpetual) { queue_all(); run_queue(); + sleep($restart_delay) if $perpetual; # Let the system breathe for a moment } unlink $lockfile; } -- 2.11.4.GIT