public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r11277 - main/trunk/pym/_emerge
@ 2008-07-30  3:33 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-07-30  3:33 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-07-30 03:33:46 +0000 (Wed, 30 Jul 2008)
New Revision: 11277

Modified:
   main/trunk/pym/_emerge/__init__.py
Log:
Put a 5 second cap on the delay produced by Scheduler._job_delay().


Modified: main/trunk/pym/_emerge/__init__.py
===================================================================
--- main/trunk/pym/_emerge/__init__.py	2008-07-30 03:17:11 UTC (rev 11276)
+++ main/trunk/pym/_emerge/__init__.py	2008-07-30 03:33:46 UTC (rev 11277)
@@ -8862,6 +8862,7 @@
 		# The load average takes some time to respond when new
 		# jobs are added, so we need to limit the rate of adding
 		# new jobs.
+		self._job_delay_max = 5
 		self._job_delay_factor = 0.5
 		self._previous_job_start_time = None
 
@@ -9690,8 +9691,10 @@
 
 			current_time = time.time()
 
-			if current_time - self._previous_job_start_time < \
-				self._job_delay_factor * self._jobs:
+			delay = self._job_delay_factor * self._jobs
+			if delay > self._job_delay_max:
+				delay = self._job_delay_max
+			if (current_time - self._previous_job_start_time) < delay:
 				return True
 
 		return False




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-30  3:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30  3:33 [gentoo-commits] portage r11277 - main/trunk/pym/_emerge Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox