QueueScheduler: tweak run loop logic
authorZac Medico <zmedico@gentoo.org>
Sun, 12 Feb 2012 00:05:14 +0000 (16:05 -0800)
committerZac Medico <zmedico@gentoo.org>
Sun, 12 Feb 2012 00:05:14 +0000 (16:05 -0800)
pym/_emerge/QueueScheduler.py

index 5f8cf2674935613bde0e20d761c0a0457b2742bd..731a677e5f603fff5ca07c0020b542e3e0d7a074 100644 (file)
@@ -44,15 +44,15 @@ class QueueScheduler(PollScheduler):
                                timeout, timeout_callback)
 
                try:
-                       self._schedule()
-
-                       while self._keep_scheduling() and \
-                               not (timeout_callback is not None and
+                       while not (timeout_callback is not None and
                                timeout_callback.timed_out):
                                # We don't have any callbacks to trigger _schedule(),
                                # so we have to call it explicitly here.
                                self._schedule()
-                               self.sched_iface.iteration()
+                               if self._keep_scheduling():
+                                       self.sched_iface.iteration()
+                               else:
+                                       break
 
                        while self._is_work_scheduled() and \
                                not (timeout_callback is not None and