7 from api.utils.influx import write_data_tasklist
10 class DaemonThread(threading.Thread):
12 def __init__(self, method, args):
13 super(DaemonThread, self).__init__(target=method, args=args)
15 self.command_list = args[0]
16 self.task_id = args[1]
19 timestamp = datetime.datetime.now()
22 write_data_tasklist(self.task_id, timestamp, 0)
23 self.method(self.command_list, self.task_id)
24 write_data_tasklist(self.task_id, timestamp, 1)
25 except Exception as e:
26 write_data_tasklist(self.task_id, timestamp, 2, error=str(e))
28 _handle_testsuite_file(self.task_id)
31 def _handle_testsuite_file(task_id):
33 os.remove(os.path.join(conf.TEST_SUITE_PATH, task_id + '.yaml'))
35 if e.errno != errno.ENOENT: