From 25d00e7bc361a659a729d5165fe580afcbd39664 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 16 Jul 2011 17:04:08 -0700 Subject: [PATCH] Binpkg: use fetch queue to cap fetch threads This is analogous to commit f07f8386e945b48358c11c121960e4833c539752 for bug #375331, but for fetching from binhosts. --- pym/_emerge/Binpkg.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 2.26.2