Commit d4ac5e1d authored by Alexandre Boyer's avatar Alexandre Boyer
Browse files

new attempt to fix monitor

parent 500093a5
......@@ -86,7 +86,8 @@ class ActevCommand():
StatusFactory.generateStatus(self, 'start', args.__dict__)
self.before_command(args)
Monitor(self.entry_point, args, self.command)
mon = Monitor(self.entry_point, args, self.command)
mon.run_monitor()
self.after_command(args)
logging.info("%s done" % self.command)
......
......@@ -57,8 +57,6 @@ class Monitor():
log_file_path = os.path.dirname(__file__)
self.log_file = os.path.join(log_file_path, './resources_monitoring.json')
# Run the monitoring process
self.run_monitor()
def run_monitor(self):
......@@ -69,13 +67,18 @@ class Monitor():
"""
self.main_process_pid = os.getpid()
self.main_function(**self.args.__dict__)
self.main_process = Process(target=self.main_function, kwargs=self.args.__dict__)
self.main_process.start()
self.monitor = Process(target=self.monitor_resources)
self.monitor.start()
while self.main_process.exitcode is None:
pass
if self.main_process.exitcode != 0:
raise Exception
def increment_log_file(self, log_dict):
"""Increment the file pointed by the `log_file` attribute with a new dict
......
Supports Markdown
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