Mainloop: avoid calculating timeout every time
authorGuido Trotter <ultrotter@google.com>
Fri, 20 Mar 2009 13:06:56 +0000 (13:06 +0000)
committerGuido Trotter <ultrotter@google.com>
Fri, 20 Mar 2009 13:06:56 +0000 (13:06 +0000)
set timeout_needs_update to False after calculating the timeout.

Reviewed-by: imsnah

lib/daemon.py

index 8e69b14..26f9cdf 100644 (file)
@@ -132,6 +132,7 @@ class Mainloop(object):
           # Calculate timeout again if required
           if timeout_needs_update:
             timeout = self._CalcTimeout(time.time())
+            timeout_needs_update = False
 
           # Wait for I/O events
           try: