Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit ed1d9941 authored by MOMMESSIN Clement's avatar MOMMESSIN Clement
Browse files

Handle generic external events

parent b7ab3e3d
......@@ -576,7 +576,10 @@ class Batsim(object):
self.scheduler.onNotifyEventMachineUnavailable(ProcSet.from_str(event_data["resources"]))
elif notify_type == "event_machine_available":
self.scheduler.onNotifyEventMachineAvailable(ProcSet.from_str(event_data["resources"]))
elif self.forward_unknown_events:
self.scheduler.onNotifyGenericEvent(event_data)
else:
raise Exception("Unknown NOTIFY type {}".format(notify_type))
else:
raise Exception("Unknown event type {}".format(event_type))
......@@ -766,6 +769,9 @@ class BatsimScheduler(object):
def onNotifyEventMachineAvailable(self, machines):
raise NotImplementedError()
def onNotifyGenericEvent(self, event_data):
raise NotImplementedError()
def onBeforeEvents(self):
pass
......
......@@ -75,5 +75,8 @@ class FillerSchedWithEvents(BatsimScheduler):
self.unavailableResources -= machines
self.availableResources |= machines
def onNotifyGenericEvent(self, event_data):
pass
def onNoMoreEvents(self):
self.scheduleJobs()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment