Skip to content
Snippets Groups Projects
Commit ef0b3684 authored by shinedday's avatar shinedday
Browse files

Adding ton of logs

parent 051f7822
Branches
Tags
No related merge requests found
...@@ -91,29 +91,37 @@ class Scheduler(): ...@@ -91,29 +91,37 @@ class Scheduler():
while not self.exit_bool: while not self.exit_bool:
self.__semaphore_start_stop.acquire() self.__semaphore_start_stop.acquire()
if not self.exit_bool: if self.exit_bool:
return return
self.__semaphore_start_stop.release() self.__semaphore_start_stop.release()
print("SCHEDULER : début run")
threads = [] threads = []
for schedulable in self.__schedulables: for schedulable in self.__schedulables:
current_thread = Thread(target=schedulable.run) current_thread = Thread(target=schedulable.run)
threads.append(current_thread) threads.append(current_thread)
current_thread.start() current_thread.start()
print("SCHEDULER : amas & env on cycle start")
# on cycle begin # on cycle begin
self.syncro_schedulable() self.syncro_schedulable()
self.give_amas_token() self.give_amas_token()
self.give_environment_token() self.give_environment_token()
print("SCHEDULER : amas & env on cycle begin")
# main part of the cycle # main part of the cycle
self.syncro_schedulable() self.syncro_schedulable()
self.give_amas_token() self.give_amas_token()
self.give_environment_token() self.give_environment_token()
print("SCHEDULER : amas & env on cycle end")
# on cycle end # on cycle end
for thread in threads: for thread in threads:
thread.join() thread.join()
print("SCHEDULER : amas & env done")
sleep(self.sleep_time) sleep(self.sleep_time)
print("SCHEDULER : jme ferme")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment