Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 017c1b35 authored by Thomas Lavocat's avatar Thomas Lavocat
Browse files

It's more robuste to have a per task counter instead of a global one

Because, all the undelying tasks mechnism is buggy and needs a refactor
parent 9034860b
......@@ -15,49 +15,50 @@ class TaskProcessor(FrameworkControler):
self.groups = dict()
self.tasks = []
self.register_tasks()
self.job = {}
for task in self.tasks :
task.set_framework(self)
self.groups[task.name] = task
self.job[task.name] = 1
task.register_done_callback(self.task_done)
task.register_sick_callback(self.task_sick)
task.register_run_callback(self.task_running)
task.register_err_callback(self.task_error)
task.register_timeout_callback(self.task_timeout)
task.register_cance_callback(self.task_cancel)
self.to_wait = len(self.tasks)
# to override
def register_tasks(self) :
pass
def end(self) :
self.to_wait -=1
if self.to_wait == 0 :
def end(self, name) :
self.job[name] = 0
to_wait = sum(self.job.values())
if to_wait == 0 :
self.erebor.terminate()
elif self.to_wait < 0 :
print(consts.error("ouch"))
def task_running(self, name) :
print(consts.blue("{} is {}".format(name, self.groups[name].state)))
def task_error(self, name) :
print(consts.green("{} is {}".format(name, self.groups[name].state)))
self.end()
self.end(name)
def task_timeout(self, name) :
print(consts.green("{} is {}".format(name, self.groups[name].state)))
self.end()
self.end(name)
def task_sick(self, name) :
print(consts.green("{} is {}".format(name, self.groups[name].state)))
self.end()
self.end(name)
def task_done(self, name) :
print(consts.green("{} is {}".format(name, self.groups[name].state)))
self.end()
self.end(name)
def task_cancel(self, name) :
print(consts.green("{} is {}".format(name, self.groups[name].state)))
self.end(name)
# Run some tests
def start(self, networkId):
......
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