From c3dde0c67949f60597af7cb6f7f9f7cf0cb499dc Mon Sep 17 00:00:00 2001 From: Rudi Grinberg <rudi.grinberg@sourcefabric.org> Date: Mon, 30 Jul 2012 18:02:26 -0400 Subject: [PATCH] cc-4105: respecting config files with regards to various time settings --- python_apps/media-monitor2/media/monitor/watchersyncer.py | 4 ++-- python_apps/media-monitor2/mm2.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python_apps/media-monitor2/media/monitor/watchersyncer.py b/python_apps/media-monitor2/media/monitor/watchersyncer.py index 0ca1da4bc..45b1a42d7 100644 --- a/python_apps/media-monitor2/media/monitor/watchersyncer.py +++ b/python_apps/media-monitor2/media/monitor/watchersyncer.py @@ -77,7 +77,7 @@ class WatchSyncer(ReportHandler,Loggable): def __init__(self, signal, chunking_number = 100, timeout=15): self.path = '' # TODO : get rid of this attribute everywhere #self.signal = signal - self.timeout = timeout + self.timeout = float(timeout) self.chunking_number = chunking_number self.__queue = [] # Even though we are not blocking on the http requests, we are still @@ -86,7 +86,7 @@ class WatchSyncer(ReportHandler,Loggable): self.request_running = False # we don't actually use this "private" instance variable anywhere self.__current_thread = None - tc = TimeoutWatcher(self, timeout) + tc = TimeoutWatcher(self, self.timeout) tc.daemon = True tc.start() super(WatchSyncer, self).__init__(signal=signal) diff --git a/python_apps/media-monitor2/mm2.py b/python_apps/media-monitor2/mm2.py index 997374637..8883823de 100644 --- a/python_apps/media-monitor2/mm2.py +++ b/python_apps/media-monitor2/mm2.py @@ -61,7 +61,9 @@ except Exception as e: log.info("Failed to set the locale for unknown reason. Logging exception.") log.info(str(e)) -watch_syncer = WatchSyncer(signal='watch') +watch_syncer = WatchSyncer(signal='watch', + chunking_number=config['chunking_number'], + timeout=config['request_max_wait']) try: problem_handler = ProblemFileHandler( PathChannel(signal='badfile',path='/srv/airtime/stor/problem_files/') ) except FailedToCreateDir as e: