Cancel prefetchers if they're the only reason the main poll loop is still
authorZac Medico <zmedico@gentoo.org>
Fri, 25 Jul 2008 00:12:52 +0000 (00:12 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 25 Jul 2008 00:12:52 +0000 (00:12 -0000)
running.

svn path=/main/trunk/; revision=11185

pym/_emerge/__init__.py

index fafc59f9464466b5a3db814e2a63acd0020fdc11..2e63e6a9e843d68438324614ccfcfd7f7777d119 100644 (file)
@@ -9544,6 +9544,13 @@ class Scheduler(PollScheduler):
                remaining, state_change = self._schedule_tasks_imp()
                self._task_queues.merge.schedule()
                self._status_display.display()
+
+               # Cancel prefetchers if they're the only reason
+               # the main poll loop is still running.
+               if self._failed_pkgs and \
+                       not (self._jobs or self._task_queues.merge):
+                       self._task_queues.fetch.clear()
+
                return remaining
 
        def _schedule_tasks_imp(self):