Cleaned up interval handling in ManagerTimeout and left a TODO pointing at further work

This commit is contained in:
Rudi Grinberg 2012-10-02 10:34:15 -04:00
parent f7daf4e737
commit d72a8e9686
1 changed files with 6 additions and 4 deletions

View File

@ -18,14 +18,16 @@ class ManagerTimeout(threading.Thread,Loggable):
secnods. This used to be just a work around for cc-4235 but recently
became a permanent solution because it's "cheap" and reliable
"""
def __init__(self, manager):
def __init__(self, manager, interval=3):
# TODO : interval should be read from config and passed here instead
# of just using the hard coded value
threading.Thread.__init__(self)
self.manager = manager
self.manager = manager
self.interval = interval
def run(self):
while True:
time.sleep(3)
time.sleep(self.interval) # every 3 seconds
self.manager.flush_organize()
#self.logger.info("Force flushed organize...")
class Manager(Loggable):
"""