cc-4235: removed some magic to find bug
This commit is contained in:
parent
1dbdadef62
commit
a87a790ce6
|
@ -25,7 +25,7 @@ check_airtime_events = 30 #how long to queue metadata input from airtime.
|
||||||
touch_interval = 5
|
touch_interval = 5
|
||||||
chunking_number = 450
|
chunking_number = 450
|
||||||
request_max_wait = 3.0
|
request_max_wait = 3.0
|
||||||
rmq_event_wait = 0.5
|
rmq_event_wait = 0.1
|
||||||
logpath = '/var/log/airtime/media-monitor/media-monitor.log'
|
logpath = '/var/log/airtime/media-monitor/media-monitor.log'
|
||||||
index_path = '/var/tmp/airtime/media-monitor/last_index'
|
index_path = '/var/tmp/airtime/media-monitor/last_index'
|
||||||
|
|
||||||
|
|
|
@ -47,5 +47,6 @@ class EventContractor(Loggable):
|
||||||
return True # We actually added something, hence we return true.
|
return True # We actually added something, hence we return true.
|
||||||
|
|
||||||
def __unregister(self, evt):
|
def __unregister(self, evt):
|
||||||
|
self.logger.info("Unregistering. Left: '%d'" % len(self.store.keys()))
|
||||||
try: del self.store[evt.path]
|
try: del self.store[evt.path]
|
||||||
except Exception as e: self.unexpected_exception(e)
|
except Exception as e: self.unexpected_exception(e)
|
||||||
|
|
|
@ -66,9 +66,11 @@ class BaseListener(object):
|
||||||
|
|
||||||
class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
|
class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
|
||||||
def process_IN_CLOSE_WRITE(self, event):
|
def process_IN_CLOSE_WRITE(self, event):
|
||||||
|
self.logger.info("===> IN_CLOSE_WRITE : '%s'" % event.pathname)
|
||||||
self.process_to_organize(event)
|
self.process_to_organize(event)
|
||||||
# got cookie
|
# got cookie
|
||||||
def process_IN_MOVED_TO(self, event):
|
def process_IN_MOVED_TO(self, event):
|
||||||
|
self.logger.info("===> IN_MOVED_TO : '%s'" % event.pathname)
|
||||||
self.process_to_organize(event)
|
self.process_to_organize(event)
|
||||||
|
|
||||||
def flush_events(self, path):
|
def flush_events(self, path):
|
||||||
|
@ -85,7 +87,6 @@ class OrganizeListener(BaseListener, pyinotify.ProcessEvent, Loggable):
|
||||||
flushed += 1
|
flushed += 1
|
||||||
self.logger.info("Flushed organized directory with %d files" % flushed)
|
self.logger.info("Flushed organized directory with %d files" % flushed)
|
||||||
|
|
||||||
@mediate_ignored
|
|
||||||
@IncludeOnly(mmp.supported_extensions)
|
@IncludeOnly(mmp.supported_extensions)
|
||||||
def process_to_organize(self, event):
|
def process_to_organize(self, event):
|
||||||
dispatcher.send(signal=self.signal, sender=self,
|
dispatcher.send(signal=self.signal, sender=self,
|
||||||
|
|
|
@ -15,16 +15,16 @@ class Organizer(ReportHandler,Loggable):
|
||||||
StoreWatchListener)
|
StoreWatchListener)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_instance = None
|
#_instance = None
|
||||||
def __new__(cls, channel, target_path, recorded_path):
|
#def __new__(cls, channel, target_path, recorded_path):
|
||||||
if cls._instance:
|
#if cls._instance:
|
||||||
cls._instance.channel = channel
|
#cls._instance.channel = channel
|
||||||
cls._instance.target_path = target_path
|
#cls._instance.target_path = target_path
|
||||||
cls._instance.recorded_path = recorded_path
|
#cls._instance.recorded_path = recorded_path
|
||||||
else:
|
#else:
|
||||||
cls._instance = super(Organizer, cls).__new__( cls, channel,
|
#cls._instance = super(Organizer, cls).__new__( cls, channel,
|
||||||
target_path, recorded_path)
|
#target_path, recorded_path)
|
||||||
return cls._instance
|
#return cls._instance
|
||||||
|
|
||||||
def __init__(self, channel, target_path, recorded_path):
|
def __init__(self, channel, target_path, recorded_path):
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
|
|
|
@ -124,8 +124,9 @@ class WatchSyncer(ReportHandler,Loggable):
|
||||||
try:
|
try:
|
||||||
# If there is a strange bug anywhere in the code the next line
|
# If there is a strange bug anywhere in the code the next line
|
||||||
# should be a suspect
|
# should be a suspect
|
||||||
if self.contractor.register( event ):
|
#if self.contractor.register( event ):
|
||||||
self.push_queue( event )
|
#self.push_queue( event )
|
||||||
|
self.push_queue( event )
|
||||||
except BadSongFile as e:
|
except BadSongFile as e:
|
||||||
self.fatal_exception("Received bas song file '%s'" % e.path, e)
|
self.fatal_exception("Received bas song file '%s'" % e.path, e)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue