summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-07-16 17:04:08 -0700
committerZac Medico <zmedico@gentoo.org>2011-07-16 17:04:08 -0700
commit25d00e7bc361a659a729d5165fe580afcbd39664 (patch)
treefe673dd9f8740858065d67ab843c9aa4964bba3d
parent785fe0b42a66b1d137955a4b816b3c254a1b785d (diff)
downloadportage-25d00e7bc361a659a729d5165fe580afcbd39664.tar.gz
portage-25d00e7bc361a659a729d5165fe580afcbd39664.tar.bz2
portage-25d00e7bc361a659a729d5165fe580afcbd39664.zip
Binpkg: use fetch queue to cap fetch threads
This is analogous to commit f07f8386e945b48358c11c121960e4833c539752 for bug #375331, but for fetching from binhosts.
-rw-r--r--pym/_emerge/Binpkg.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/_emerge/Binpkg.py b/pym/_emerge/Binpkg.py
index b83341941..bc6511e73 100644
--- a/pym/_emerge/Binpkg.py
+++ b/pym/_emerge/Binpkg.py
@@ -126,7 +126,12 @@ class Binpkg(CompositeTask):
short_msg = "emerge: (%s of %s) %s Fetch" % \
(pkg_count.curval, pkg_count.maxval, pkg.cpv)
self.logger.log(msg, short_msg=short_msg)
- self._start_task(fetcher, self._fetcher_exit)
+
+ # Allow the Scheduler's fetch queue to control the
+ # number of concurrent fetchers.
+ fetcher.addExitListener(self._fetcher_exit)
+ self._task_queued(fetcher)
+ self.scheduler.fetch.schedule(fetcher)
return
self._fetcher_exit(fetcher)