From 77497106fbcb7626ecdf7ef4882aef7690f6f6a9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 15 Jul 2008 00:50:13 +0000 Subject: [PATCH] Split out a _main_loop_cleanup() method from Scheduler._merge() and call it before restarting in _restart_if_necessary() to kill any parallel-fetch tasks that may still be running. svn path=/main/trunk/; revision=11050 --- pym/_emerge/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index b80f60c69..a2c7b19e7 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -8730,6 +8730,8 @@ class Scheduler(PollScheduler): if self._pkg_count.curval >= self._pkg_count.maxval: return + self._main_loop_cleanup() + logger = self._logger pkg_count = self._pkg_count mtimedb = self._mtimedb @@ -8902,12 +8904,7 @@ class Scheduler(PollScheduler): try: self._main_loop() finally: - # discard remaining packages if necessary - del pkg_queue[:] - self._completed_tasks.clear() - self._digraph = None - self._task_queues.fetch.clear() - + self._main_loop_cleanup() # discard any failures and return the # exist status of the last one if failed_pkgs: @@ -8917,6 +8914,12 @@ class Scheduler(PollScheduler): return rval + def _main_loop_cleanup(self): + del self._pkg_queue[:] + self._completed_tasks.clear() + self._digraph = None + self._task_queues.fetch.clear() + def _choose_pkg(self): """ Choose a task that has all it's dependencies satisfied. -- 2.26.2