summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/Scheduler.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index d3f77611d..6502f71c5 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -733,15 +733,13 @@ class Scheduler(PollScheduler):
continue
prefetcher = self._create_prefetcher(pkg)
if prefetcher is not None:
- self._task_queues.fetch.add(prefetcher)
+ # This will start the first prefetcher immediately, so that
+ # self._task() won't discard it. This avoids a case where
+ # the first prefetcher is discarded, causing the second
+ # prefetcher to occupy the fetch queue before the first
+ # fetcher has an opportunity to execute.
prefetchers[pkg] = prefetcher
-
- # Start the first prefetcher immediately so that self._task()
- # won't discard it. This avoids a case where the first
- # prefetcher is discarded, causing the second prefetcher to
- # occupy the fetch queue before the first fetcher has an
- # opportunity to execute.
- self._task_queues.fetch.schedule()
+ self._task_queues.fetch.add(prefetcher)
def _create_prefetcher(self, pkg):
"""