From 7dc76508d38370f3cf68029fae2ffb7749a580b2 Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Thu, 12 May 2011 20:12:22 +0000 Subject: if a LoopingCall has canceled the loop, break out early instead of sleeping any more than needed --- nova/utils.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nova/utils.py') diff --git a/nova/utils.py b/nova/utils.py index 80bf1197f..44ee1b623 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -459,6 +459,8 @@ class LoopingCall(object): try: while self._running: self.f(*self.args, **self.kw) + if not self._running: + break greenthread.sleep(interval) except LoopingCallDone, e: self.stop() -- cgit