From: Zac Medico Date: Sun, 17 Jul 2011 00:04:08 +0000 (-0700) Subject: Binpkg: use fetch queue to cap fetch threads X-Git-Tag: v2.2.0_alpha46~9 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=25d00e7bc361a659a729d5165fe580afcbd39664;p=portage.git Binpkg: use fetch queue to cap fetch threads This is analogous to commit f07f8386e945b48358c11c121960e4833c539752 for bug #375331, but for fetching from binhosts. --- 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)