Pick events class from v4

This commit is contained in:
nemunaire 2014-09-23 22:27:53 +02:00
parent 04eccbe250
commit acded35e1a
6 changed files with 82 additions and 49 deletions

View file

@ -205,11 +205,17 @@ class EventConsumer:
def run(self, context):
try:
self.evt.launch_check()
self.evt.check()
except:
logger.exception("Error during event end")
# Reappend the event in the queue if it has next iteration
if self.evt.next is not None:
context.add_event(self.evt, self.evt.id)
context.add_event(self.evt, eid=self.evt.id)
# Or remove reference of this event
elif hasattr(self.evt, "module_src") and self.evt.module_src is not None:
self.evt.module_src.REGISTERED_EVENTS.remove(self.evt.id)