def registerWorker(self):
start_time = strftime("%Y-%m-%d %H:%M:%S %Z")
hostname = check_output("hostname").rstrip()
ip = gethostbyname(gethostname()).rstrip()
self.cur.execute("insert into worker(worker_id, hostname, ip, time_start, time_finish) values (?,?,?,?,NULL);",
(self.worker_id, hostname, ip, start_time) )
self.cur.execute("select * from desired_solution")
for row in self.cur.fetchall():
key = str(row['des_solution_id'])
self.des_solutions[key] = {'status': str(row['status']), 'des_solution_id': str(row['des_solution_id'])}
self.cur.execute("select generated_solution_id from generated_solution")
for row in self.cur.fetchall():
self.gen_solutions_id[str(row['generated_solution_id'])] = '1'
return 0
评论列表
文章目录