
+ result_dict = monitor({ 'job_id' => job_id, 'job_state' => state }, { 'stop' => true }, '1800').result + time_list.push(Time.parse(result_dict[0]['time'])) unless result_dict.nil? + end + return time_list
"return time_list" => "time_list" the function monitor() return "monitor" without "return" so we'd better keep the same style
ok
+end + +def es_search(job_id) + es_list = [] + query_field = %w[job_state result_root] + query_field.each do |field| + es = ESQuery.new + result_dict = es.query_by_id(job_id) + es_list.push(result_dict[field]) unless result_dict.nil? + end + return es_list
ok Thanks, Yinsi
ditto
Thanks, Weitao
+end + +def find_by_id(job_id) + start_time, end_time = monitor_state(job_id) + cost_time = end_time - start_time unless end_time.nil? + + job_state, result_root = es_search(job_id) + + return start_time, end_time, cost_time.to_i.floor, job_state, result_root +end + def run_qemu Process.fork do %x(#{ENV['CCI_SRC']}/providers/my-qemu.sh >/dev/null 2>&1) -- 2.23.0