diff --git a/python_apps/media-monitor/media-monitor.cfg b/python_apps/media-monitor/media-monitor.cfg index 546230b3d..b1167f56b 100644 --- a/python_apps/media-monitor/media-monitor.cfg +++ b/python_apps/media-monitor/media-monitor.cfg @@ -25,7 +25,7 @@ check_airtime_events = 30 #how long to queue metadata input from airtime. touch_interval = 5 chunking_number = 450 request_max_wait = 3.0 -rmq_event_wait = 0.5 +rmq_event_wait = 0.1 logpath = '/var/log/airtime/media-monitor/media-monitor.log' index_path = '/var/tmp/airtime/media-monitor/last_index' diff --git a/python_apps/media-monitor2/media/monitor/eventcontractor.py b/python_apps/media-monitor2/media/monitor/eventcontractor.py index cbc1f5c90..75fb384df 100644 --- a/python_apps/media-monitor2/media/monitor/eventcontractor.py +++ b/python_apps/media-monitor2/media/monitor/eventcontractor.py @@ -47,5 +47,6 @@ class EventContractor(Loggable): return True # We actually added something, hence we return true. def __unregister(self, evt): + self.logger.info("Unregistering. Left: '%d'" % len(self.store.keys())) try: del self.store[evt.path] except Exception as e: self.unexpected_exception(e) diff --git a/python_apps/media-monitor2/media/monitor/listeners.py b/python_apps/media-monitor2/media/monitor/listeners.py index ecc2b793a..6b959f250 100644 --- a/python_apps/media-monitor2/media/monitor/listeners.py +++ b/python_apps/media-monitor2/media/monitor/listeners.py @@ -66,9 +66,11 @@ class BaseListener(object): class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable): def process_IN_CLOSE_WRITE(self, event): + self.logger.info("===> IN_CLOSE_WRITE : '%s'" % event.pathname) self.process_to_organize(event) # got cookie def process_IN_MOVED_TO(self, event): + self.logger.info("===> IN_MOVED_TO : '%s'" % event.pathname) self.process_to_organize(event) def flush_events(self, path): @@ -85,7 +87,6 @@ class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable): flushed += 1 self.logger.info("Flushed organized directory with %d files" % flushed) - @mediate_ignored @IncludeOnly(mmp.supported_extensions) def process_to_organize(self, event): dispatcher.send(signal=self.signal, sender=self, diff --git a/python_apps/media-monitor2/media/monitor/organizer.py b/python_apps/media-monitor2/media/monitor/organizer.py index e5d0247de..7bab09fd5 100644 --- a/python_apps/media-monitor2/media/monitor/organizer.py +++ b/python_apps/media-monitor2/media/monitor/organizer.py @@ -15,16 +15,16 @@ class Organizer(ReportHandler,Loggable): StoreWatchListener) """ - _instance = None - def __new__(cls, channel, target_path, recorded_path): - if cls._instance: - cls._instance.channel = channel - cls._instance.target_path = target_path - cls._instance.recorded_path = recorded_path - else: - cls._instance = super(Organizer, cls).__new__( cls, channel, - target_path, recorded_path) - return cls._instance + #_instance = None + #def __new__(cls, channel, target_path, recorded_path): + #if cls._instance: + #cls._instance.channel = channel + #cls._instance.target_path = target_path + #cls._instance.recorded_path = recorded_path + #else: + #cls._instance = super(Organizer, cls).__new__( cls, channel, + #target_path, recorded_path) + #return cls._instance def __init__(self, channel, target_path, recorded_path): self.channel = channel diff --git a/python_apps/media-monitor2/media/monitor/watchersyncer.py b/python_apps/media-monitor2/media/monitor/watchersyncer.py index c400ad6d5..c1c7a610c 100644 --- a/python_apps/media-monitor2/media/monitor/watchersyncer.py +++ b/python_apps/media-monitor2/media/monitor/watchersyncer.py @@ -124,8 +124,9 @@ class WatchSyncer(ReportHandler,Loggable): try: # If there is a strange bug anywhere in the code the next line # should be a suspect - if self.contractor.register( event ): - self.push_queue( event ) + #if self.contractor.register( event ): + #self.push_queue( event ) + self.push_queue( event ) except BadSongFile as e: self.fatal_exception("Received bas song file '%s'" % e.path, e) except Exception as e: