From ea2013904cf3f388a91a68d36af270e682db3739 Mon Sep 17 00:00:00 2001 From: boyska Date: Thu, 19 Jan 2017 11:35:33 +0100 Subject: [PATCH] log scheduling events clearer --- larigira/event.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/larigira/event.py b/larigira/event.py index 1b6b273..36bb1ca 100644 --- a/larigira/event.py +++ b/larigira/event.py @@ -130,17 +130,20 @@ class Monitor(ParentedLet): # why this 2*EVENT_TICK_SECS? EVENT_TICK_SECS would be enough, # but it is "tricky"; any small delay would cause the event to be # missed - if delta is not None and delta <= 2*self.conf['EVENT_TICK_SECS']: + if delta is None: + self.log.debug('Skipping event %s: will never ring', + alarm.get('nick', alarm.eid)) + elif delta <= 2*self.conf['EVENT_TICK_SECS']: self.log.debug('Scheduling event %s (%ds) => %s', alarm.get('nick', alarm.eid), - delta if delta is not None else -1, + delta, [a.get('nick', a.eid) for a in actions] ) self.schedule(alarm, actions, delta) else: self.log.debug('Skipping event %s too far (%ds)', alarm.get('nick', alarm.eid), - delta if delta is not None else -1, + delta, ) def schedule(self, timespec, audiospecs, delta=None):