Only allow one repeating even of each type
Previously if duplicates of a skill should be launched or a skill isn't properly
shutdown when reloaded multiple handlers could be registred. This commit disables multiples of repeating events.
@@ -101,6 +101,12 @@ class EventScheduler(Thread):
event, sched_time, repeat, data = self.add.get(timeout=1)
# get current list of scheduled times for event, [] if missing
event_list = self.events.get(event, [])
+
+ # Don't schedule if the event is repeating and already scheduled
+ if repeat and event in self.events:
+ LOG.debug('Repeating event {} is already scheduled, discarding'
+ .format(event))
+ else:
# add received event and time
event_list.append((sched_time, repeat, data))
self.events[event] = event_list
